mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-18 02:21:47 -05:00
Added precaution to avoid creating multiple Complimentary plans
refs https://github.com/TryGhost/Ghost-Admin/pull/1430 - When the client creates a complimentary plan with other currency than USD we should not allow for it to avoid creating a mess in the Stripe plans
This commit is contained in:
parent
71395fcfcb
commit
5f0d2168f3
1 changed files with 5 additions and 0 deletions
|
@ -36,6 +36,11 @@ module.exports = class StripePaymentProcessor {
|
|||
|
||||
this._plans = [];
|
||||
for (const planSpec of config.plans) {
|
||||
// NOTE: we have only one "Complimentary" plan throughout the system
|
||||
if (planSpec.name === 'Complimentary' && planSpec.currency !== 'usd') {
|
||||
return;
|
||||
}
|
||||
|
||||
const plan = await api.plans.ensure(this._stripe, planSpec, this._product);
|
||||
this._plans.push(plan);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue