#lordgrim97
1 messages · Page 1 of 1 (latest)
If you try to just update the Subscription quantity again (calling another Update API), what happens then?
it will again try to generate the invoice and record payment for that.
But the issue is, I don't know to what quantity I need to revert to.
Before the subscription is updated first time, you can save its quantity somewhere to reference to, no? Or you can look at the customer.subscription.updated and see the previous attributes
let's say we have the previous quantity.
Updates will be as follow:
S1 - I1 (quantity 5) - $50
S1 - I2 (quantity 10) - $100
now, payment to invoice I2 get's failed, $50 will come in Credit balance (which never got paid)
Revert
S1 - I3 (quantity 5) - $0
now next invoice will try to use the $50 credit balance which never got paid.
I see, I think you would want to adjust the credit balance to undo the side effect of I2 too