#Naveed | Web3Auth
1 messages · Page 1 of 1 (latest)
Hi there!
So when I tried to simply run the confirmPayment function above again it doesn't work.
Can you clarify what you mean by "it didn't work"? Can you share the request ID (req_xxx)? You can find it here https://dashboard.stripe.com/test/logs
-
1st time clicking confirm and 3d secure pops up but i purposely fail it req_LSha6nxRnRTUtw
-
2nd time clicking confirm but error req_YTXQooKNvB00Ar
I think the error message is pretty clear:
You cannot confirm this PaymentIntent because it's missing a payment method.
If the PaymentIntent is requires_payment_method, you need to collect a payment method first
But i do have a payment method with which i am confirming the intent
i mean this error is only coming up when i fail the 3d secure on purpose
and then try it again
but if i simply went for confirming it and suceeding in the 3d secure itd go ahead as expected
Are you using the Payment Element? If so the flow should look like this:
- Customer submit the form
- The 3DS popup appears
- The fail the 3DS flow
- The Payment Element is still displayed with their card information <= this step is important, since the PaymentIntent needs a payment method
- You confirm the PaymentIntent
- The 3DS popup appears
in my case I do not need to show the payment element to input card details
because the subcription charges default payment method, in this case its already available for the customer
so thats why all im doing is confirming payment and passing the client secret which is from the incomplete subscriptions invoice payment intent
If you already have an existing payment method saved, then make sure to pass it when trying to confirm the PaymentIntent https://stripe.com/docs/api/payment_intents/confirm#confirm_payment_intent-payment_method
so how come in the beginning i dont need to do this
but only upon failing 3d secure and trying again i need to do it
Because, like you said at the beginning, after 3DS fails the PaymentIntent status is requires_payment_method. And as its name implies, it needs a PaymentMethod.
How can I specify that here https://stripe.com/docs/js/payment_intents/confirm_payment
in the stripe js function confirmPayment
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!