Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- One time payment
- Customer enters card details and presses "pay one time" button
- 1/ [server-side] create a PaymentIntent
- 2/ [client-side] call confirmCardPayment() and pass in the cardElement
- Done
- Subscription
- Customer enters card details and presses "subscribe" button
- 1/ [client-side] create a PaymentMethod token
- 2/ [server-side] attach that PM token to Customer
- 3/ [server-side] create a Subscription on that Customer and card
- 4/ [client-side] case of first payment requiring authentication, if the subscription.latest_invoice.payment_intent is in "status: requires_action", then back on your webpage, call confirmCardPayment
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement