Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Un-canceling a Stripe subscription

Suppose a user wants to cancel their subscription, so I issue a command like this:

stripe_subscription.delete(at_period_end: true)

Later, though—before the period ends—the user changes their mind. Is there a call I can issue to undo the scheduled cancellation?

If not, what's the best way to implement this? My best guess looks like this:

new_subscription = stripe_customer.subscriptions.create(plan: stripe_subscription.plan.id, trial_end: stripe_subscription.current_period_end)
stripe_subscription.delete()   # if permitted
self.stripe_subscription = new_subscription
save!

Is there something better I can do?

like image 574
Becca Royal-Gordon Avatar asked Feb 14 '15 04:02

Becca Royal-Gordon


People also ask

How do I Uncancel a subscription?

On your Android device, go to your subscriptions in Google Play. Select the subscription you want to cancel. Tap Cancel subscription. Follow the instructions.

How do I resume my Stripe subscription?

You can not reactivate the subscription. You need to create a new subscription for the user.

What does Cancelled mean on Stripe?

It's just people that didn't finish the checkout. Errors on payment. Some merchants have been worried by errors that appear in the logs when we're communicating with Stripe. These errors are normal and are Stripe's way of responding to bad data like misspelled emails or when the card couldn't be charged.

What happens when a Stripe subscription fails?

Failed payments If automatic payment fails, the subscription updates to past_due and Stripe attempts to recover payment based on your retry rules. If payment recovery fails, you can set the subscription status to canceled , unpaid , or leave it past_due .


3 Answers

If the subscription is still active, you just have to update the current subscription and pass the plan id once again and it would resume the subscription.

In PHP you would do:

$customer = Stripe_Customer::retrieve("cus_XXX");
$subscription = $customer->subscriptions->retrieve("sub_YYY");
$subscription->plan = "myPlanId";
$subscription->save();

This is covered in one of Stripe's support article in more details here.

like image 193
koopajah Avatar answered Oct 01 '22 00:10

koopajah


Not sure if the accepted answer is an old one, but for the latest version of Stripe you have to do this (in PHP):

$sub->cancel_at_period_end = false;
return $sub->save();
like image 25
supersan Avatar answered Sep 30 '22 23:09

supersan


From the dashboard. Go to your Subscription details and click Edit Details top corner right. A modal untitled "Reactivate subscription" should pop saying

This subscription is set to cancel at the end of the period. You can reactivate the subscription and it'll continue as usual.

Click Reactivate

EDIT

It seems that the actions now appear on mouse over the remaining days before cancellation:

enter image description here

Note that it wont show if the subscription is already canceled.

like image 29
RafaSashi Avatar answered Oct 01 '22 00:10

RafaSashi