#uh oh
1 messages ยท Page 1 of 1 (latest)
The subscription doesn't have that status but the subscription will have a latest_invoice and that invoice will have a payment intent in the requires_action state
We have a section in our docs about this. You can also listen for invoice.payment_action_required webhooks to be notified of this https://stripe.com/docs/billing/subscriptions/overview#requires-action
So I need to make another call to Stripe to get the invoice object?
What call are you currently making? If you are already getting or creating the subscription, you can use the expand parameter to make sure the invoice and its payment intent are already included in the response https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
const sub = await stripe.subscriptions.create(
{
customer: stripe_customer_id,
items: [{ price: price_stripe_id }],
proration_behavior: 'none',
}, {
stripeAccount: ".......",
expand: ['latest_invoice'],
}
);```
Would it be like this?
Yes, though you would likely want to expand latest_invoice.payment_intent if you are looking for whether 3DS is needed. I don't think the invoice will have any info specifically about that
Right now, in the subscription object that's being returned, latest_invoice is only a string
not an object
Sounds like expand isn't being passed in properly.
Oh in our ref, expand goes in the first hash not the second. Can you try moving it there?
It worked! thank you!
Quick question about renewals for subscriptions. If a customer uses a payment method that requires 3DS, would it ask for 3DS when the subscription is renewed? or it's only when the subscription is first created
๐ stepping in