#suraj_bhan_tech
1 messages · Page 1 of 1 (latest)
Hi 👋 that sounds like expected behavior. confirmPayment is only expected to redirect on successful confirmations, otherwise it returns an error:
https://stripe.com/docs/js/payment_intents/confirm_payment
I believe if you want to also redirect on failures, then you will need to add your own logic to perform that redirect when an error is returned from confirmPayment.
I also want to know about the else statement in case of !error what should we do ?
or is it taken care by stripe?
I don't think you'll reach the else block, because confirmPayment will either fail with an error or cause the browser to be redirected before its promise resolves.
ok thanks Toby that sounds good👍
Any time!