#coachleyton
1 messages · Page 1 of 1 (latest)
Can you share the subscription ID (sub_xxx)?
Sure, sub_1NcHweHxbsbtU2J3n4x06O1d
This is visualised in the UI of my website, where I display a history of all invoices (except the one in the state of "draft")
that bottom one should say "Standard" rather than "Ultimate", maybe the same with the second one also, that's probably a bug on my end lol
ignore the names there
In https://dashboard.stripe.com/test/invoices/in_1NcHyWHxbsbtU2J3UiB8FU4Y, the payment was failed from the failed test card 0341
Yes, so the second payment fails, because I intentionally switched the payment method for the subscription to one that will fail, just to see how my app will behave in that scenario
As the user, you're then instructed to update the payment method for your subscription so that the invoice can be paid. But really, there's nothing stopping the user from ignoring that, and just changing their subscription to something else rather than paying for something they might not want
and lets say they upgrade their subscription
On my subscription update API call, I have ProrationBehavior = "always_invoice", therefore it will pro-rate the difference. However, only the "difference" ends up getting paid, because the previous invoice is still left in a state of "open" and therefore unpaid
My apologies if I haven't communicated my question effectively
Every invoice is independent. When Stripe attempts to charge the payment on https://dashboard.stripe.com/test/invoices/in_1NcHyWHxbsbtU2J3UiB8FU4Y, the failed test card was used and thus payment failure. Stripe will retry the payments as per retry schedule setting here: https://dashboard.stripe.com/settings/billing/automatic
In this invoice page, the status showed that this invoice will be retried.
The past invoice doesn't get charged immediately once the customer the payment method. It'll follow the retry schedule instead
I see. So when the user updates their subscription, in this instance, I want to check for any open invoices and pay them immediately using the new payment method that they provided when they sign up for the new subscription?
If you wish to make an invoice payment immediately instead of the automatic retry, Pay Invoice API can be used: https://stripe.com/docs/api/invoices/pay
Yeah, I can use the pay endpoint of the invoices API, I'm just asking generally what's the approach taken in this scenario. To make things simpler, I could just prevent the user from changing their subscription if their current one is past_due. They'd have to cancel first, and then upgrade. In fact, I think I'll do that.
Thank you for your help 🙂