mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-01 02:41:39 -05:00
Removed unused getPublicPlans method
refs: https://github.com/TryGhost/Team/issues/1625 - this method makes use of defunct settings
This commit is contained in:
parent
cd20738d65
commit
403b311f54
1 changed files with 0 additions and 30 deletions
|
@ -53,36 +53,6 @@ class MembersConfigProvider {
|
|||
return this.getEmailSupportAddress() || this.getEmailFromAddress();
|
||||
}
|
||||
|
||||
getPublicPlans() {
|
||||
const defaultPriceData = {
|
||||
monthly: 0,
|
||||
yearly: 0,
|
||||
currency: 'USD'
|
||||
};
|
||||
|
||||
try {
|
||||
const plans = this._settingsCache.get('stripe_plans') || [];
|
||||
|
||||
const priceData = plans.reduce((prices, plan) => {
|
||||
const numberAmount = 0 + plan.amount;
|
||||
const dollarAmount = numberAmount ? Math.round(numberAmount / 100) : 0;
|
||||
return Object.assign(prices, {
|
||||
[plan.name.toLowerCase()]: dollarAmount
|
||||
});
|
||||
}, {});
|
||||
|
||||
priceData.currency = plans[0].currency || 'USD';
|
||||
|
||||
if (Number.isInteger(priceData.monthly) && Number.isInteger(priceData.yearly)) {
|
||||
return priceData;
|
||||
}
|
||||
|
||||
return defaultPriceData;
|
||||
} catch (err) {
|
||||
return defaultPriceData;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {'direct' | 'connect'} type - The "type" of keys to fetch from settings
|
||||
* @returns {{publicKey: string, secretKey: string} | null}
|
||||
|
|
Loading…
Add table
Reference in a new issue