【发布时间】:2021-05-14 13:28:53
【问题描述】:
我无法向 Stripe 客户收费。虽然这个问题在过去被问过十几次,但他们的错误都与我的问题不符。
我在 node.js 中将此函数称为 firebase 函数
const charge = await stripe.charges.create({
customer : customerId,
amount : amount,
currency : currency
});
请求 POST 正文
{
"customer": "cus_JL4hVfDnym2SIk",
"amount": "500",
"currency": "usd"
}
我已确认 Stripe Dashboard 上的所有值都是正确的。我也将测试卡存储在客户身上,它被明确设置为默认值,我也在仪表板上确认了这一点。我在一个非常不同的步骤存储卡信息,不像其他帖子一次处理这一切。
我只想向帐户中存有卡的客户收费。一切都在测试数据、测试卡等上。这是使用收费 api 的问题吗?还是因为某种原因测试卡在这里不起作用?
错误响应正文
{
"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"
}
}
【问题讨论】:
标签: stripe-payments