内容"/>
Stripe.Customers.listSources不返回任何内容
我创建了以下代码来为我的客户获取所有卡:
return stripe.customers.listSources(customerId, {
object: "card",
limit: 10
}).then(cards => {
if (cards) {
res.status(200).send({
cards: cards.data
});
return;
}
res
.status(500)
.send({ error: "error getting cards" });
})
.catch(error => {
console.log(error);
res.status(500).send({ error: "error getting cards" });
});
遵循此文档:
我还向客户添加了可在仪表板中看到的测试卡:
但是API始终会向我返回以下结果:
{
object: 'list',
data: [],
has_more: false,
url: '/v1/customers/<my_cus_id>/sources'
}
回答如下:似乎使用它代替了:
stripe.paymentMethods.list(
{ customer: customerId, type: "card" }
)
https://stripe/docs/api/payment_methods/list
更多推荐
Stripe.Customers.listSources不返回任何内容
发布评论