#hendr1x
1 messages · Page 1 of 1 (latest)
Actually it looks like I already have the payment_intent + payment_intent_client_secret...I don't even need to save it
It is saved/generated server side when I created the payment intent
Gotcha, glad that may not be necessary. For the redirect, you can pass redirect: 'if_required' to tell Stripe.js not to redirect from the page unless you are using a payment method that requires a full page redirect. That mostly means that cards will not redirect, we can look in to other kinds of payment methods if you are unsure about them https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-redirect
ok. I don't think I want to create multiple payment flows. If that is the case I have to handle all fields (my form data) on this page with ajax first and then allow stripe to do its redirect correct?
As in use that ajax request to send data back to your server and then call confirmPayment? That makes sense to me. The one thing I can think of that might be a concern is that Apple Pay will error out if the sheet isn't shown pretty quickly after the user clicks on your pay button. If that request takes too long it could prevent apple pay from showing properly
What data are you passing back with this ajax request?
billing address
Have you considered using the Address Element or just passing in the address or the payment_method_data.billing_address parameter and then getting this info from the payment intent later?
https://stripe.com/docs/elements/address-element
https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method_data-billing_details