How-to guides
v0.0.1
Each guide covers one task with Mishka Pay, in any Phoenix app or inside Mishka CMS, where every call names its site as the tenant: take a one-time payment, sell and change subscriptions, refund and capture, save customers and open the billing portal, receive webhooks, run many sites on one Stripe platform, count tax and send invoices, bill by usage, take PayPal payments, test your code and keep payments in Ash resources.
Pick the guide for the job in front of you. The pages below show each one with a short summary.
- Take a one-time payment Take a one-time payment with Mishka Pay and Stripe: build a checkout, add discounts and shipping, pick a hosted or embedded form and read it back.
- Sell and manage subscriptions Sell a plan with Mishka Pay and Stripe: start a subscription, read its status, change plans, pause, cancel and plan changes ahead with schedules.
- Refund, hold and capture a payment Hold a card payment and capture it later, refund all or part of a payment, answer a dispute and set how often a site can refund with Mishka Pay.
- Save customers and cards, and open the billing portal Create Stripe customers, save cards without a charge, change the default card, open the billing portal and erase a customer with Mishka Pay.
- Receive and verify webhooks Mount the Mishka Pay webhook endpoint, set up Stripe thin or snapshot events, handle an event in Elixir, roll a secret and replay missed events.
- Run many sites on one Stripe platform Give each site its own Stripe connected account with Mishka Pay: create accounts, onboard sellers, take an application fee and move money.
- Count tax, send invoices and issue credit notes Count tax with Stripe Tax, set rates by hand, send one-off invoices, add invoice items and issue credit notes from Elixir with Mishka Pay.
- Bill by usage with meters Bill by usage with Stripe meters in Elixir: make a meter and a metered price, report usage once, correct a mistake and read a summary.
- Take payments with PayPal Take PayPal payments and subscriptions with Mishka Pay: set the keys, create a checkout, capture on return and see what PayPal does not support.
- Test code that takes payments Test Elixir code that takes payments with the Mishka Pay test kit: stub the provider, sign webhook events, use Stripe's mock server and test clocks.
- Keep payments in Ash resources and Mishka CMS Keep payments, subscriptions, customers and disputes in Ash resources with Mishka Pay, gate content by plan and serve many sites in Mishka CMS.