#Stone.D-Subscription

1 messages · Page 1 of 1 (latest)

timid patio
#

Hi there, do you mean to undo the last update call?

remote jetty
#

yes

crystal anchor
#

stepping in on behalf of orakaro. You'll do the same thing as when you upgraded, except use the previous Price instead

remote jetty
#

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

crystal anchor
#

you're missing the specific subscription item id to update

remote jetty
#

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.

crystal anchor
#

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?

remote jetty
#

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.

crystal anchor
#

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

remote jetty
#

This doesn't fit our scenario, we need proration

crystal anchor
#

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"?

remote jetty
#

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.

crystal anchor
#

are you planning to invoice the customer immediately upon upgrade?

remote jetty
#

YES

crystal anchor
#

gimme a while to get back to you.

proper marsh
#

you should have a look at the pending update feature so the change to the subscription only happens when a payment is successful.