#jason_paymentmethod-upfront

1 messages · Page 1 of 1 (latest)

strong wharfBOT
#

👋 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.

quartz radish
#

jason_paymentmethod-upfront

old panther
#

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?

quartz radish
#

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

  1. (client-side) Render PaymentElement to collect their payment method details
  2. (client-side) Create a ConfirmationToken
  3. (server-side) Check the PaymentMethod used on the ConfirmationToken and decide your fee/discount and create/confirm a PaymentIntent
  4. (client-side) Handle additional next action if needed
old panther
#

Ahhh, I see. That makes sense. Thank you! 🙌

quartz radish
#

Sure thing!