Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reactivate subscription #626

Open
maxipeli opened this issue Jan 21, 2019 · 3 comments
Open

reactivate subscription #626

maxipeli opened this issue Jan 21, 2019 · 3 comments

Comments

@maxipeli
Copy link

maxipeli commented Jan 21, 2019

Hi,

Thank you very much for this amazing library. I am trying to reactivate a cancelled subscription (the subscription period does not end yet), but I am not finding the way to do it.

I am not sure if it's a issue, or maybe this feature is not developed yet.

Thanks for your help!

Updated

I am using actions functions. My problem is that I cancel a subscription with the function 'cancel' of the actions of subscriptions, but I would like to offer to my user the possibility of enabled again the subscription, I mean put again the field 'at_period_end' to False.

@KatherineMichel
Copy link
Member

It looks to me like what is happening is that the subscription is cancelled through SubscriptionDeleteView.
https://github.com/pinax/pinax-stripe/blob/master/pinax/stripe/views.py#L132
It looks as though that view calls a function in actions/subscriptions.py
https://github.com/pinax/pinax-stripe/blob/master/pinax/stripe/actions/subscriptions.py#L11
I think there is an option to cancel at the end of the subscription through at_period_end or immediately. After the delete, the view is redirected to SubscriptionListView, which has the option to create or update a subscription. I don't think there is an option to reactivate. It looks like it's best to use at_period_end instead.
https://github.com/pinax/pinax-stripe/blob/master/pinax/stripe/views.py#L99
There are people here with more experience with pinax-stripe than me who might have more input.

@maxipeli
Copy link
Author

@KatherineMichel, thanks for your help. I have updated my issue to explain that I am not using the views.

As you said the best option seem to be to use at_period_end, but I did not see how to put again it to False. In the View to update a Subscription you can change the plan, but I was not able to see how to change any other field.

@KatherineMichel
Copy link
Member

@maxipeli It looks like there is an issue related to this referenced in the recent pinax-stripe sprint. #617

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants