-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Change plan and Cancel subscription have inconsistent subscription end behaviors #61
Comments
For the cancellation policy, and @pydanny mentioned this in a TODO comment in views.py, let's pass at_period_end in and control it from settings. And since we're there, we should similarly take care of prorate (which is set when a customer subscribes to a plan in models.py). The thing is these two are mutually exclusive: if a provider allows proration on cancellation, then a subscription should end right away, i.e. if proration policy is True, then cancel at_period_end is False, and vice versa. What is a clean way to parametrize this? In settings, having the following and commenting it would do the job, but would be ugly: PRORATION_POLICY = False
CANCELLATION_AT_PERIOD_END = not PRORATION_POLICY Adding a self-guard method that checks that the two are indeed mutually exclusive and raises an exception otherwise could add some robustness. Another suggestion? |
Hi, I've looked into this for the past few days, and if my interpretation is correct, most membership website have a policy like this:
I think a policy like this solves two issues:
Right now, I can't implement this scheme. So I propose we make the prorate a parameter to the subscribe function with a default value of False to be compatible with the current code base. Thanks, Melvin |
Thank you @mlvn23 for looking into this. The current scheme is already defaulted to False as for the proration policy and consequently makes a customer switch from their current plan to an upgraded or downgraded one while starting and being charged right away for the new plan. The model you're describing makes better sense and is consistent with Stripe's model:
I was also wondering how Stripe manages the fees that it charges for each transaction and whether the provider were to be held liable when a customer upgrades their plan. In fact, no, as long as the customer's balance contains charges that were not already refunded. So crediting a customer by refunding those (or part of those) charges back implies also getting the provider refunded for Stripe's fees (https://stripe.com/docs/api#refund_charge). |
Hi @dollydagr, What I meant was to change the function prototype as follows so that when a customer upgrades, we can prorate it. As it is, we have no control over proration from an external app.
It's actually not fair to charge the customer when he upgrades the plan without proration. For example, on day 1, he buys silver plan which should be good for 30 days. On day 2, he upgrades to gold plan. He'll be charged for the gold plan without being compensated by the 29 days that he paid for the silver plan. Thanks, mlvn23 |
Oh I see your point now. So, at this point, we're pretty close to getting the upgrade scenario implementation specified: The one spot where I see we should verify if we are in an upgrade situation is in ChangePlanView class in views.py. If we are, then we call the subscribe method with prorate=True. But now I wonder:
|
I think the upgrade / downgrade policies are tied to the company policy, so we definitely can't force it to everybody. Also, for backward compatibility, we might want to leave the current behavior as it is. I think the important thing right now is for the API to allow proration so that it's possible to implement the "standard" scheme. In the long run, it might be better to implement the policies as an external app (like django-billing and django-plans). Actually, the downgrade API (from the model perspective... I'm using custom views) already supports it (prorate=False), so it's possible to implement the "standard" scheme. The complication happens on how to keep track of the "features / quota" when the "last paid subscription level" is not the same as the "next subscription level," but this is app-specific and I don't think it should be in djstripe. It's actually quite complex and I ended up implementing it with a state machine. |
I've got a couple TODOs in the docs that are related to this issue: http://dj-stripe.readthedocs.org/en/latest/settings.html#djstripe-proration-policy-false 😉 |
Nice! @pydanny, let me know if I can contribute to the docs. |
Please do! I think you have a clearer understanding of what this does. |
This seems to have been implemented according to @pydanny's link to the docs above. Point 2 of that setting now works correctly. |
Hi @pydanny,
What I mean by that is that:
I don't know if this behavior was meant to be the way it is. To make things consistent, I believe either:
For my project, I opted for the latter.
What do you think?
The text was updated successfully, but these errors were encountered: