#jason_paymentmethod-upfront
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1250129308924641403
📝 Have more to share? Add details, code, screenshots, videos, etc. below.
@old panther the best approach is to use this integration path: https://docs.stripe.com/payments/accept-a-payment-deferred
jason_paymentmethod-upfront
Which part of that, specifically? We are using automatic_payment_methods, but we're not sure — in JS — which payment method is currently selected — CC, BECS, ACH, etc.
Basically, is there a callback for when the user changes the payment method?
For example, there's a <Form onDiscountCode={} /> callback. Is there a <Form onMethodChanged={} /> callback?
It's not a callback, it's a completely different integration path really. So I recommend reading the doc and implementing that to get a feel for it. But in a nutshell it's
- (client-side) Render PaymentElement to collect their payment method details
- (client-side) Create a ConfirmationToken
- (server-side) Check the PaymentMethod used on the ConfirmationToken and decide your fee/discount and create/confirm a PaymentIntent
- (client-side) Handle additional next action if needed
Ahhh, I see. That makes sense. Thank you! 🙌
Sure thing!