在创建 Stripe Checkouts 表单时,我似乎找不到任何选项来向 Stripe Charge 方法添加数量,以便客户可以看到客户订购了多少。我搜索了Stripe 的 API文档,找不到任何关于向收费方法添加数量的内容(订阅计划有一个数量参数,但这不是我想要的)。有没有我缺少的关键字?还是 Stripe 不支持数量?
stripe(STRIPE_SECRET_KEY).charges.create({
quantity: 2,
receipt_email: body.stripeEmail,
amount: body.amount,
currency: body.currency,
source: body.stripeToken,
description: body.description
}, (err, charge) => {
console.log(body.amount, body.currency);
const status = err ? 400: 200;
const message = err ? err.message: 'Payment successfully completed!';
res.writeHead(status, { 'Content-Type': 'text/html' });
return res.end('<h1>' + message + '</h1>');
});
});