0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Fixed members subscription amount default/empty value

no issue
This commit is contained in:
Rish 2019-10-04 20:23:50 +05:30
parent 3974dd5615
commit d9351f7292

View file

@ -71,8 +71,8 @@ export default Controller.extend({
});
let monthlyPlan = stripeProcessor.config.plans.find(plan => plan.interval === 'month');
let yearlyPlan = stripeProcessor.config.plans.find(plan => plan.interval === 'year');
monthlyPlan.dollarAmount = isNumber(monthlyPlan.amount) ? (monthlyPlan.amount / 100) : '';
yearlyPlan.dollarAmount = isNumber(yearlyPlan.amount) ? (yearlyPlan.amount / 100) : '';
monthlyPlan.dollarAmount = parseInt(monthlyPlan.amount) ? (monthlyPlan.amount / 100) : 0;
yearlyPlan.dollarAmount = parseInt(yearlyPlan.amount) ? (yearlyPlan.amount / 100) : 0;
stripeProcessor.config.plans = {
monthly: monthlyPlan,
yearly: yearlyPlan
@ -199,7 +199,7 @@ export default Controller.extend({
if (key === 'month' || key === 'year') {
stripeConfig.plans = stripeConfig.plans.map((plan) => {
if (key === plan.interval) {
plan.amount = isNumber(event.target.value) ? event.target.value * 100 : '';
plan.amount = parseInt(event.target.value) ? (event.target.value * 100) : 0;
}
return plan;
});