Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Fix signup not setting subscription with BF coupon #315

Merged
merged 1 commit into from
Nov 8, 2019

Conversation

vincaslt
Copy link
Contributor

@vincaslt vincaslt commented Nov 8, 2019

  1. Coupon which still had leftover amount to pay (BF) did not pass it when subscribing, so it was failing.
  2. When plans were bundled, I forgot to add the bundled plan info in addition to fake bundle plan.

@@ -140,9 +140,11 @@ const useSignup = (onLogin, { coupon, invite, availablePlans = VPN_PLANS } = {},

const bundlePlans =
bundle && plans.filter(({ Name, Type }) => Type === PLAN_TYPES.PLAN && bundle.includes(Name));
const bundlePlan = bundle && (await getPlansWithCoupon(bundlePlans, model.planName));
const bundlePlan = bundle && getPlansWithCoupon(bundlePlans, model.planName);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Irrelevant change really, but it was unnecessary to wait for promise here.

} else if (paymentDetails) {
return { Token: paymentDetails.VerifyCode, TokenType: TOKEN_TYPES.PAYMENT };
} else if (coupon) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coupon used to take priority, and payment details would not be applied, but there would still be some amount to pay, so it failed to signup. This is an oversight because I was testing with coupons that had 100% discount...

@EpokK EpokK merged commit ecd20bf into master Nov 8, 2019
@EpokK EpokK deleted the fix/coupons-signup branch November 8, 2019 16:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants