Skip to content

Commit

Permalink
Fix reactivate() with Stripe API 2018-02-28 and above
Browse files Browse the repository at this point in the history
  • Loading branch information
jleclanche committed Aug 11, 2018
1 parent 9a43955 commit 4d4975d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion djstripe/models/billing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,11 @@ def reactivate(self):
.. warning:: Reactivating a fully canceled Subscription will fail silently. Be sure to check the returned \
Subscription's status.
"""
return self.update(plan=self.plan)
stripe_subscription = self.api_retrieve()
stripe_subscription.plan = self.plan.id
stripe_subscription.cancel_at_period_end = False

return Subscription.sync_from_stripe_data(stripe_subscription.save())

def is_period_current(self):
""" Returns True if this subscription's period is current, false otherwise."""
Expand Down

0 comments on commit 4d4975d

Please sign in to comment.