Advertisement
hmunoz-stripe

payment flow on single page

Mar 23rd, 2021
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. One time payment
  2. Customer enters card details and presses "pay one time" button
  3. 1/ [server-side] create a PaymentIntent
  4. 2/ [client-side] call confirmCardPayment() and pass in the cardElement
  5. Done
  6.  
  7. Subscription
  8. Customer enters card details and presses "subscribe" button
  9. 1/ [client-side] create a PaymentMethod token
  10. 2/ [server-side] attach that PM token to Customer
  11. 3/ [server-side] create a Subscription on that Customer and card
  12. 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
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement