#coachleyton

1 messages · Page 1 of 1 (latest)

austere lynxBOT
cobalt gust
#

Can you share the subscription ID (sub_xxx)?

arctic relic
#

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

cobalt gust
arctic relic
#

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

cobalt gust
#

The past invoice doesn't get charged immediately once the customer the payment method. It'll follow the retry schedule instead

arctic relic
#

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?

cobalt gust
arctic relic
#

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 🙂