Skip to content
Permalink
Browse files

fix(donate): control plan creation with environment variable

  • Loading branch information
raisedadead committed Nov 19, 2019
1 parent 21b09b5 commit 2cb8c16b28507d01c6e706b36476c0006cfc11d5
Showing with 16 additions and 9 deletions.
  1. +11 −7 api-server/server/boot/donate.js
  2. +5 −2 sample.env
@@ -78,13 +78,17 @@ export default function donateBoot(app, done) {
}
const requiredPlans = subscriptionPlans.map(plan => plan.id);
const availablePlans = stripePlans.data.map(plan => plan.id);
requiredPlans.forEach(requiredPlan => {
if (!availablePlans.includes(requiredPlan)) {
createStripePlan(
subscriptionPlans.find(plan => plan.id === requiredPlan)
);
}
});
if (process.env.STRIPE_CREATE_PLANS === 'true') {
requiredPlans.forEach(requiredPlan => {
if (!availablePlans.includes(requiredPlan)) {
createStripePlan(
subscriptionPlans.find(plan => plan.id === requiredPlan)
);
}
});
} 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

0 comments on commit 2cb8c16

Please sign in to comment.
You can’t perform that action at this time.