#el_quick
1 messages · Page 1 of 1 (latest)
Hi there!
In which case would you receive a invoice.payment_failed when the customer is on session? When you create a brand new subscription?
Yes! with 3ds for example
Then you can check billing_reason on the invoice https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason
trying create a new brand subscription by using a card which requires 3ds authentication, the billing_reason has a subscription_update value
So, I'll get the same value when the invoice payment fails and the user is off line
If it's a brand new subscription it should be subscription_create
It would be ok if I expand the charge and check for its failure_code ?
I just realized that subscription comes null, since I need to send the email just when a subscription renewal fails, I think I can send the email only when the subscription is not null
Yes, that could work!
Thank you! anyhow, is not weird that the billing_reason is coming with a subscription_update value?
Can you share the invoice ID (in_xxx)?
Sure: in_1MdahBKC4Ot1qhBTej9SUHrr
where do you see that exactly? On that invoice I see "billing_reason": "subscription_create", , on https://dashboard.stripe.com/test/events/evt_1MdahEKC4Ot1qhBTkGC9IdrV for example.
are you calling the API with an old version forced?
if you use old versions before https://stripe.com/docs/upgrades#2018-10-31 then you can't get subscription_create
Yes, I'm using the 2017-08-15 version
that's why then
Got it! I will look for another way to resolve it for now. While I get the time to switch the api version
Btw, in the url that you sent me (I only add the connected account id), I continue seeing subscription_update
it probably renders differently when you're looking at it as the platform(as your platform has the older version)