Skip to content

Instantly share code, notes, and snippets.

@skolhustick
Created August 6, 2019 15:49
Show Gist options
  • Save skolhustick/1781542d06a61427647e26c67f045aa5 to your computer and use it in GitHub Desktop.
Save skolhustick/1781542d06a61427647e26c67f045aa5 to your computer and use it in GitHub Desktop.
const createPlan = async productId => {
const PLAN_NICKNAME = "Monthly Subscription Plan";
const PLAN_INTERVAL = "month";
const CURRENCY = "usd";
const PLAN_PRICE = 200;
const plan = await stripe.plans.create({
product: productId,
nickname: PLAN_NICKNAME,
currency: CURRENCY,
interval: PLAN_INTERVAL,
amount: PLAN_PRICE,
});
console.log(plan);
return plan.id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment