【发布时间】:2022-01-27 20:35:45
【问题描述】:
所以我在 Stripe 中收到“无法向没有有效卡的客户收费”的错误。 我正在为此使用节点 js
付款代码如下
try {
const customer = await stripe.customers.create({
email: req.body.email,
source: req.body.id,
});
const payment = await stripe.charges.create(
{
amount: req.body.totalAmount * 100,
currency: "inr",
customer: customer.id,
receipt_email: req.body.email,
confirm: true,
off_session: true,
},
{
idempotencyKey: uuidv4(),
}
);
我收到以下错误
type: 'StripeCardError',
raw: {
code: 'missing',
doc_url: 'https://stripe.com/docs/error-codes/missing',
message: 'Cannot charge a customer that has no active card',
param: 'card',
type: 'card_error',
}
【问题讨论】:
标签: javascript node.js mongodb stripe-payments mern