#Stone.D-Subscription
1 messages · Page 1 of 1 (latest)
yes
stepping in on behalf of orakaro. You'll do the same thing as when you upgraded, except use the previous Price instead
As you,
SubscriptionUpdateParams.Builder subscriptionUpdateParamsBuilder
= SubscriptionUpdateParams.builder();
SubscriptionUpdateParams.Item.Builder itemBuilder
= SubscriptionUpdateParams.Item.builder();
itemBuilder.setPrice("price_1LIrBKIXF5VHSVPpKn0dGQMa");
subscriptionUpdateParamsBuilder
= subscriptionUpdateParamsBuilder.setProrationBehavior(SubscriptionUpdateParams.ProrationBehavior.ALWAYS_INVOICE);
subscriptionUpdateParamsBuilder
= subscriptionUpdateParamsBuilder.addItem(itemBuilder.build());
com.stripe.model.Subscription subscription
= stripeSubscription.update(subscriptionUpdateParamsBuilder.build());
Got :
com.stripe.exception.InvalidRequestException: Currency and interval fields must match across all plans on this subscription. Found mismatch in interval field.; request-id: req_3O8yKqryltBG44
you might want to refer to this guide : https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#changing
you're missing the specific subscription item id to update
Ok let me try
That's ok; but it doesn't called rollback; That's downgrade.
These are difference in Refunds and Charges.
I want to rollback not downgrade.
there's no way to "undo" or "rollback" as you put it. You need to downgrade back to the previous Price
what specifically doesn't work for you when you downgrade back to the previous Price?
Upgrade with proration, then downgrade back with proration the next some day, the amount of the money of two times is not equal zero.
Maybe billing cycle anchor is difference too.
then you need to implement your own logic to determine when it would be a "rollback" e.g. if the customer reverts back within 24 hours and it's the same as the previous Price. You would also need to disable prorations for the current change, issue a credit for the previous proration, and change the billing cycle anchor too
in short, there's no feature for you to "rollback", you need to implement the logic
This doesn't fit our scenario, we need proration
i'm sorry, i don't quite understand?
you disable prorations for the current downgrade and issue a credit/debit for the previous change - if you do these, it be net 0. Is this not what you're looking for when you say "rollback"?
Let me detail it, Use proration (business requirements) to upgrade, and the upgrade fee is calculated according to the proration method. For example, if you subscribed to a monthly package of $5 on January 1, and try to upgrade to $10 on a pro rata basis on January 15, you should pay $2.5 for the pro rata upgrade. Assuming that the payment is not successful this time due to a card failure, after 1 day (January 16 Day) The user changed the card that can pay successfully and tried to pay to upgrade to another package. I want to rollback the original failed upgrade (the one on January 15), and then carry out a new upgrade.
are you planning to invoice the customer immediately upon upgrade?
YES
gimme a while to get back to you.