#streetfeels
1 messages · Page 1 of 1 (latest)
That is possible, though you would effectively have to do a lot of extra coding to make the UI as simple as that. Essentially you'd have 2 flows that happen behind the scenes:
(1) save and use for payment: https://stripe.com/docs/payments/quickstart#save , or
(2) just use for payment: https://stripe.com/docs/payments/quickstart
Depending on whether or not a radio button was toggled, you would need to listen for that action and decide which flow to follow
Ok thanks for that! Super helpful!
Follow up question, this would have to be done before the Payment Intent is created right? Before the loading of the Payment Element?
on our site we collect the user amount to be charged and then load the payment element on a second screen
You wouldn't necessarily need to do it before creation of the Payment Intent or Payment Element, though it would be easier to code (e.g. less stuff needs to be done) if you did.
If you need to do asynchronous updates to them, you can use fetch() to make a server-side API call to update the Payment Intent at anytime after the Payment Element loads, but in order for the Payment Element to have state on the update, you need to make a elements.fetchUpdates() call: https://stripe.com/docs/js/elements_object/fetch_updates
ok awesome, I think this is what we need - and it's possible to just make an update to the Payment Intent by referencing the payment intent id?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.