#cnguyen-save-card
1 messages · Page 1 of 1 (latest)
Thank you.
I have to display first a payment form with Stripe Element (at this moment, I know only the customer information and an indicative price). But the price will be updated and validated on the next page.
So, the user enter his credit card information, then we go on the next page. And, on the next page, according to his choice, he can have a discount for example.
And at this moment (second page), I know the final price, and I want to launch an authorize on it. But without to ask the payment information again. I want to use the information added on the previous step.
I think about save the card without make a payment and use it, just after. But I want to be on-session and display the 3DS confirmation if needed
gotcha so
what you can do is
1/ page 1, use Elements to create a PaymentMethod
2/ next page, use that PaymentMethod ID and a Customer ID to create a PaymentIntent (on your backend)
3/ Confirm the PaymentIntent client-side with Stripe.js
1/ When I create a Payment method, It's only on the front part ? I can use it later, on the next page to create my PI on-session ?
2/ So, on this page, I don't need to display the form again. And I can show the 3DS if needed with confirmCardPayment?
1/ When I create a Payment method, It's only on the front part ? I can use it later, on the next page to create my PI on-session ?
yes
I don't need to display the form again. And I can show the 3DS if needed with confirmCardPayment?
yes
1/ What's the method to save the card? (just to be sure)
so you're not saving the card, you are just creating a PaymentMethod out of it
it is createPaymentMethod()
The saving of the card happens in your PaymentIntent confirmation on your webpage, of you pass setup_future_usage: off_session , that saves the card to the Customer