-
Notifications
You must be signed in to change notification settings - Fork 50
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
Deal better with plan downgrades. #1382
base: master
Are you sure you want to change the base?
Conversation
847fd42
to
c18166e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could probably do with a bit more documentation but this looks good to me.
if ($form_data['coupon']) { | ||
$this->stripe->coupon = $form_data['coupon']; | ||
} elseif ($this->stripe->discount) { | ||
$this->stripe->deleteDiscount(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice to have a comment in here with either an explanation of what this is for or a link to one because trying to derive it all from code isn't easy :)
classes/Subscription.php
Outdated
} else { | ||
# An upgrade higher than where they started the month - upgrade | ||
# back to the original without proration, then upgrade to new | ||
# plan from there, removing the old maximum_plan. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be useful to mention in here that this is because stripe doesn't handle this case so need to do two step.
c18166e
to
8a9e357
Compare
e38971a
to
779d185
Compare
0ecdd22
to
59a2af8
Compare
8c1c8bc
to
9611368
Compare
f880855
to
d17f6a3
Compare
152a3d0
to
89dc131
Compare
c792d3a
to
af10fb2
Compare
bc5c83e
to
9ed6db5
Compare
5d1c590
to
1ccc60d
Compare
81c138e
to
7328522
Compare
See https://github.com/mysociety/better-cities/issues/19 for full discussion. I keep asking myself if I've missed something obvious but it doesn't seem so. Perhaps you will spot/think of something.
If the logic seem okay, will copy to MapIt and add tests there, probably easier place for them.