#Kenny Kemsley
1 messages · Page 1 of 1 (latest)
Sorry that's not possible in a mere one transaction. If you collect the card information beforehand (like using SetupIntent) then you will have the detail before actually creating a PaymentIntent
Would we be able to use SetupIntent on our payment screen after the user has entered their details? We technically would be able to have all their details, we could possible run SetupIntent after the user has filled all fields but before they click our "process payment" button but would that work?
No it doesn't work like that. SetupIntent work exactly like PaymentIntent, when you create it beforehand on backend, then use its clientSecret to display the UI on frontend, then confirm it on frontend
The differences are you don't actually charge your customer, but instead keep a registered Payment Method (pm_xxx) collected inside the SetupIntent
Ok so basically we would need to add another screen where the user would setup their payment method, we would use SetupIntent there and then on the next screen we would use PaymentIntent? Would this then give us details on whether or not the card is domestic or international? I can't see anywhere in documentation that displays the fee that would be applied to that card based on card type
Are there any alternative ways to solve this problem? we could also declare that international cards occur a fee but would stripe be able to charge more based on card region?
Ok so basically we would need to add another screen where the user would setup their payment method, we would use SetupIntent there and then on the next screen we would use PaymentIntent?
Yes, and in next screen you can already charge your customer server-side, after knowing their payment method pm_xxx, and its detail (international or domestic) and calculate your amount
ie. you can look at the collected PaymentMethod inside the SetupIntent and view it's card's country: https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-country
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
(all of this can be done server-side, after you have successfully confirmed the SetupIntent)
Ok, thanks for your help