fix(donate): control plan creation with environment variable
This commit is contained in:
@ -78,6 +78,7 @@ export default function donateBoot(app, done) {
|
||||
}
|
||||
const requiredPlans = subscriptionPlans.map(plan => plan.id);
|
||||
const availablePlans = stripePlans.data.map(plan => plan.id);
|
||||
if (process.env.STRIPE_CREATE_PLANS === 'true') {
|
||||
requiredPlans.forEach(requiredPlan => {
|
||||
if (!availablePlans.includes(requiredPlan)) {
|
||||
createStripePlan(
|
||||
@ -85,6 +86,9 @@ export default function donateBoot(app, done) {
|
||||
);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
log(`Skipping plan creation`);
|
||||
}
|
||||
});
|
||||
resolve();
|
||||
});
|
||||
|
@ -16,8 +16,11 @@ SESSION_SECRET=secretstuff
|
||||
COOKIE_SECRET='this is a secret'
|
||||
JWT_SECRET='a very long secret'
|
||||
|
||||
STRIPE_PUBLIC=pk_from_stipe_dashboard
|
||||
STRIPE_SECRET=sk_from_stipe_dashboard
|
||||
STRIPE_CREATE_PLANS=true
|
||||
STRIPE_PUBLIC_KEY=pk_from_stripe_dashboard
|
||||
STRIPE_SECRET_KEY=sk_from_stripe_dashboard
|
||||
SERVICEBOT_ID=servicebot_id_from_servicebot_dashboard
|
||||
SERVICEBOT_HMAC_SECRET_KEY=secret_key_from_servicebot_dashboard
|
||||
|
||||
PAYPAL_SUPPORTERS=1703
|
||||
|
||||
|
Reference in New Issue
Block a user