#RMoura_JS-recurring
1 messages · Page 1 of 1 (latest)
you can definitely get a link to handle 3D Secure v2 if you want
In the case of 3d secure, it was easy since the response includes a redirect link
I assume you wrote code that looked insidenext_action[use_stripe_sdk]? that was wrong
the correct way is https://stripe.com/docs/payments/3d-secure#manual-redirect — if you pass a return_url when confirming the PaymentIntent it will return a URL
works the same for 3DSv2 and v1
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-next_action-use_stripe_sdk
The shape of the contents is subject to change and is only intended to be used by Stripe.js.
the fact it sometimes have a URL is an implementation detail and we specifically don't document that hash because you should never write code to look at it.
If you want to return a URL you can, as described above!
Ok! makes sense!
now having said that, yes, you should not email that link directly to the customer(because it might expire). You should direct them to your site and then your site can confirm the PaymentIntent and handle 3DS that way
Can I provide stripe.js the paymentIntent id that failed with a requires actions error, and stripe.js will do what needs to be done (such as redirecting the user to the 3ds auth)?
yes!
it's described in detail at https://stripe.com/docs/payments/save-during-payment?platform=web#web-create-payment-intent-off-session
If the payment failed due to an authentication_required decline code, use the declined PaymentIntent’s client secret and payment method with confirmCardPayment to allow the customer to authenticate the payment.
Thank you so much 🙂
I think I understand!
Just to confirm: when the payment status is requires_confirmation?/ requires_action? can I do this confirmpayment with stripe.js? (When should I do this confirmpayment?)
calling confirmCardPayment does a few things — it attempts to confirm the PaymentIntent (which is charging the customer), if that attempt fails due to 3DS being needed, the PaymentIntent moves to requires_action and confirmCardPayment internally, all in this one call, will present the 3D Secure interface; and then return back to you the final status(hopefully paid) when it's all done
so you can pass it a PaymentIntent in either of those statuses and it should do the right thing and work
So now im using the confirm payment (server side) and im getting the next_action. Here can I redirect the user to next_action.redirect_to_url.url?
Am i corret?
yep, if the customer is present at the time you're doing this, you can redirect them from your site to that URL if that's the goal