Cannot get to "requires_action" path after "requires_payment_method"
Problem
I am going through the subscriptions integration. I am at the point of integrating 3D-secure authentication path outcome 4 If I input a 3D-secure card first time - it works fine. However, If the first card I use fails (4000000000000341) and the subscription has status `incomplete` with `requires_payment_method` and THEN i try a 3D-secure card like 4000000000003220 - the `invoice.pay` method throws error instead of giving me an invoice object with a `payment_intent.status` of `requires_action` as its expected from the link provided hence I cannot show the user the modal to verify with 3D-secure. The error thrown is the following (invoice_payment_intent_requires_action) - google can't find anything for the error [code block] stripes-node version: v7.0.0 node version: v11.13.0
Error Output
error instead of giving me an invoice object with a `payment_intent.status` of `requires_action` as its expected from the link provided hence I cannot show the user the modal to verify with 3D-secure.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Cannot get to "requires_action" path after "requires_payment_method"
Hey @LabN36 , I noticed the same issue and also did not receive adequate support form stripe. Your suggestions helped me. However, I used a differenet method which did not require me to save the payment_intent in my database. Similarly to you, I also checked on the server `if (err.raw.code === "invoice_payment_intent_requires_action")`. The way I see it, there are two options to pass the subscript
Trust Score
3 verifications
- 1
Hey @LabN36 , I noticed the same issue and also did not receive adequate support
The way I see it, there are two options to pass the subscription object including the payment_method to the client.
- 2
Fetch the proper payment method with this code:
`stripe.paymentIntents.list({ customer: customer.id })` and access the first payment_intent from the data array. Finally pass it to the client.
- 3
If you have access to the customer's subscription.id, which I assume you do, you
`stripe.subscriptions.retrieve(previousSubscription.id, { expand: ["latest_invoice.payment_intent"] })`
- 4
The benefit of the second option is that it works well with the `resolvePayment(
The benefit of the second option is that it works well with the `resolvePayment(subscription)` method on the client side as provided by stripe. However, my only concern would be that a not-up-to-date version of the subscription and is latest_invoice are sent to the client.
Validation
Resolved in stripe/stripe-node GitHub issue #628. Community reactions: 2 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep