我正在尝试创建带有条带的订阅,并且他们在他们的文档中添加了硬编码的源,但是我认为这应该为每个用户生成... https://stripe.com/docs/billing/quickstart
我如何创建此源?
用户付款时,表单上的操作会将其带给执行此操作的控制器:
exports.goProPay = async (req, res) => {
const customer = await stripe.customers.create({
email: req.body.email,
});
const subscription = await stripe.subscriptions.create({
customer: customer.id,
items: [{plan: 'plan_ElVkJ345s0xwbw'}],
});
res.render('homepage', { title: 'Homepage' });
};
我应该在订阅功能上添加源,但是如何? https://stripe.com/docs/billing/quickstart