#scotty-setupintent-confirmation
1 messages · Page 1 of 1 (latest)
Hello! stripe.confirmSetup performs a redirect to your return_url if everything goes well, so everyhting in .then won't run because the page will have been unloaded. That .then code only runs if something goes wrong with stripe.confirmSetup.
Oh interesting, even if I set "redirect" to "if_required", the .then won't run? So best to use a webhook to save the card info?
You have to assume that stripe.confirmSetup will always redirect. Even if you have it set to if_required that means it will still redirect if required.
So yeah, you need to not have any critical code in that .then path. That should only be for handling errors as described here in the Returns section: https://stripe.com/docs/js/setup_intents/confirm_setup
scotty-setupintent-confirmation
Gotcha thanks @autumn barn. So I need to use a webhook to save the payment method? Was hoping to avoid this because users get redirected to the payment page, and since the webhook takes a few seconds, I don't have a great way to handle that. Any suggestions?
What have you tried exactly? What do you see happen after the redirect?