#kristin-evercharge_api

1 messages ¡ Page 1 of 1 (latest)

slate echoBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1224770548891127909

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

tender ibexBOT
raw prairie
#

You can then decide if you should display an error or proceed to using a Setup Intent, for example.

short gazelle
#

Oh interesting. This is specifically in conjunction with a PaymentRequest button; we are using the SetupIntent to render that to collect payment information. Would we be able to access the payment method object after that step?

raw prairie
#

Yeah, if you're using the Payment Request Button it will fire a paymentmethod event when someone confirms the payment. That event will have a paymentMethod property that contains the Payment Method.

#

Do you currently have code like paymentRequest.on('paymentmethod', ...?

short gazelle
#

Yes, we do

raw prairie
#

Okay, so in there you should be passing a function that takes the event as an argument. Try accessing the paymentMethod property on that event when you get it.

short gazelle
#

Fantastic, thank you so much

raw prairie
#

Happy to help!

#

Note that's client-side code and subject to being altered. What you might want to do at that step is pass the Payment Method's ID to your server, then fetch the Payment Method from the API, check the funding type and whatnot, then proceed accordingly from there.