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

Add an Prorate() function to reverse the noProrate() function #647

Closed
yougotnet opened this issue Apr 18, 2019 · 1 comment · Fixed by #886
Closed

Add an Prorate() function to reverse the noProrate() function #647

yougotnet opened this issue Apr 18, 2019 · 1 comment · Fixed by #886

Comments

@yougotnet
Copy link

  • Cashier Version: 9.3.0
  • Laravel Version: 5.8+
  • PHP Version: 7+
  • Database Driver & Version:

Description:

The problem with the noProrate option is that when you execute a swap right afterward a swap with noProrate() function you can't turn on Prorate.

If I have a user downgrade the plan, I do not want to prorate or give a refund, but if the user downgrades and then upgrades higher to what the originally paid during the subscription period, then I want to swap to the original plan with noProrate and then swap to a higher plan with a Prorate.

What I did to fix the issue on my end is add a new function to the Subscription model called Prorate() so that I can turn the $prorate flag to true. If you would simply add the function to the base code it would help a lot of developers out.

Steps To Reproduce:

@driesvints
Copy link
Member

Okay, I could see the benefit of this. Feel free to suggest something but please add a test as well.

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