-
Notifications
You must be signed in to change notification settings - Fork 523
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
Fix the credit card verification #7376
Conversation
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.
Looks good! Just one minor edit I'd recommend.
} | ||
} | ||
throw new Error(`no such iOS plan ${planName}`) | ||
} else { | ||
const displayPrice = formatPrice(price, true) | ||
return { displayPrice, rawPrice: rawPrice.toString() } |
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.
return { displayPrice, rawPrice: rawPrice.toString() } | |
return { displayPrice, rawPrice } |
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.
Good catch, I will change it.
case PaymentInterval.Yearly: | ||
return mobilePlan.yearlyPerYear | ||
return { displayPrice: mobilePlan.yearlyPerYear, rawPrice: rawPrice.toString() } |
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.
return { displayPrice: mobilePlan.yearlyPerYear, rawPrice: rawPrice.toString() } | |
return { displayPrice: mobilePlan.yearlyPerYear, rawPrice } |
if (isIOSApp()) { | ||
const planName = PlanTypeToName[subscription] | ||
const mobilePlan = this.getMobilePrices().get(planName.toLowerCase()) | ||
if (mobilePlan) { | ||
switch (paymentInterval) { | ||
case PaymentInterval.Monthly: | ||
return mobilePlan.monthlyPerMonth | ||
return { displayPrice: mobilePlan.monthlyPerMonth, rawPrice: rawPrice.toString() } |
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.
You already have rawPrice as a string, so you needn't convert it again.
return { displayPrice: mobilePlan.monthlyPerMonth, rawPrice: rawPrice.toString() } | |
return { displayPrice: mobilePlan.monthlyPerMonth, rawPrice } |
This fixes the currency symbol being included and the decimal separator in the call to the Braintree card verification causing it to fail. It is not possible to have `getSubscriptionPriceWithCurrency` return without currency formatting because the return of `getPlanPrices` cannot be changed as `StoreKit` can only return the price in the local currency. Closes #7370. Co-authored-by: wec <wec@tutao.de>
da15044
to
6832af6
Compare
This fixes the currency symbol being included and the decimal separator in the call to the Braintree card verification causing it to fail.
It is not possible to have
getSubscriptionPriceWithCurrency
return without currency formatting because the return ofgetPlanPrices
cannot be changed asStoreKit
can only return the price in the local currency.Closes #7370.