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

Plan-restricted coupon works for another plan too #488

Closed
ollipuu opened this issue Oct 25, 2018 · 2 comments · Fixed by #489
Closed

Plan-restricted coupon works for another plan too #488

ollipuu opened this issue Oct 25, 2018 · 2 comments · Fixed by #489
Assignees
Labels

Comments

@ollipuu
Copy link

ollipuu commented Oct 25, 2018

While building our webshop I stumbled into an issue with coupons. There is a closed issue #175 closely related to this, as the steps to reproduce are exactly the same, although the inverse version I couldn't reproduce.

So we have two plans, planA ($100) and planB ($237) and we have a coupon (20% off) that can be used to planB only.

// RESULT: error: {name: "api-error", code: "not-found", message: "this coupon cannot be redeemed"}
myPricing.plan('planA', { quantity: 1 }).coupon('myCoupon');

// RESULT: price: { now: {subtotal: "189.60", plan: "237.00", addons: "0.00", setup_fee: "0.00", discount: "47.40", total: "189.60"} }
myPricing.plan('planB', { quantity: 1 }).coupon('myCoupon');

// RESULT: price: { now: {subtotal: "80.00", plan: "100.00", addons: "0.00", setup_fee: "0.00", discount: "20.00", total: "80.00"} }
myPricing.plan('planA', { quantity: 1 }).coupon('myCoupon'); 

Thanks,
Olli

chrissrogers added a commit that referenced this issue Oct 30, 2018
- When switching plans on a SubscriptionCheckout instance,
  the constituent discounts must be checked for compatibility and
  removed accordingly
- Fixes #488
@chrissrogers
Copy link
Member

Thanks very much for the report, and sorry to not update you sooner. I was able to verify the issue and have written a fix which should go into the next version. No release date as yet, but I will keep you apprised.

@chrissrogers chrissrogers self-assigned this Oct 30, 2018
chrissrogers added a commit that referenced this issue Oct 31, 2018
- When switching plans on a SubscriptionCheckout instance,
  the constituent discounts must be checked for compatibility and
  removed accordingly
- Fixes #488
chrissrogers added a commit that referenced this issue Oct 31, 2018
- When switching plans on a SubscriptionCheckout instance,
  the constituent discounts must be checked for compatibility and
  removed accordingly
- Fixes #488
@csmb csmb closed this as completed in #489 Oct 31, 2018
@ollipuu
Copy link
Author

ollipuu commented Nov 1, 2018

Great, thanks for the fix!

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

Successfully merging a pull request may close this issue.

2 participants