0
Fork 0
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:
Nazar Gargol 2020-02-27 13:53:05 +08:00
parent 71395fcfcb
commit 5f0d2168f3

View file

@ -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);
}