我创建了以下代码来获取客户的所有卡: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" }); });遵循本文档:https://stripe.com/docs/api/cards/list我还向我的客户添加了测试卡,这些卡在仪表板中可见:但 API 始终向我返回以下结果:{ object: 'list', data: [], has_more: false, url: '/v1/customers/<my_cus_id>/sources'}
1 回答

湖上湖
TA贡献2003条经验 获得超2个赞
似乎使用这个代替工作:
stripe.paymentMethods.list(
{ customer: customerId, type: "card" }
)
https://stripe.com/docs/api/payment_methods/list
添加回答
举报
0/150
提交
取消