【发布时间】:2021-01-05 22:59:30
【问题描述】:
我正在尝试向已创建的客户收费,但出现错误 "无法向没有有效卡的客户收费"
卡片也已经添加了
这是我用来向客户收费的 node.js 代码
const response = await stripe.charges.create({
'amount': amount,
'currency': currency,
'description': title,
'customer': customer,
}, { idempotencyKey: onDemandId });
// What I am sending
{
"amount": "40",
"currency": "usd",
"description": "120 دقيقة",
"customer": "cus_I33Z2JrUSj1bBm"
}
// What I am getting
{
"error": {
"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"
}
}
知道为什么会出现此错误吗?
【问题讨论】:
标签: node.js google-cloud-functions stripe-payments