mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
🐛 Fixed complimentary plan currency change when yearly currency was changed
refs https://github.com/TryGhost/Ghost/issues/11649 - The bug was changing all complimentary plan prices to the value of yearly. - This is another point to putting in place validation of plan setting object on the server side so we don't accidentally allow values like this to slip through
This commit is contained in:
parent
da3f92fac4
commit
ecf718b028
1 changed files with 2 additions and 2 deletions
|
@ -63,7 +63,7 @@ export default Component.extend({
|
|||
return (proc.adapter === 'stripe');
|
||||
});
|
||||
let monthlyPlan = stripeProcessor.config.plans.find(plan => plan.interval === 'month');
|
||||
let yearlyPlan = stripeProcessor.config.plans.find(plan => plan.interval === 'year');
|
||||
let yearlyPlan = stripeProcessor.config.plans.find(plan => plan.interval === 'year' && plan.name !== 'Complimentary');
|
||||
|
||||
// NOTE: need to be careful about division by zero if we introduce zero decimal currencies
|
||||
// ref.: https://stripe.com/docs/currencies#zero-decimal
|
||||
|
@ -136,7 +136,7 @@ export default Component.extend({
|
|||
}
|
||||
if (key === 'month' || key === 'year') {
|
||||
stripeConfig.plans = stripeConfig.plans.map((plan) => {
|
||||
if (key === plan.interval) {
|
||||
if (key === plan.interval && plan.name !== 'Complimentary') {
|
||||
plan.amount = parseInt(event.target.value) ? (event.target.value * 100) : 0;
|
||||
}
|
||||
return plan;
|
||||
|
|
Loading…
Add table
Reference in a new issue