首页 > 解决方案 > 无法使用 listSources 或 listCards 方法检索卡片

问题描述

成功向客户添加了一张卡片(使用 Stripe.js createSource 创建,使用 stripe-node createSource 附加),我无法使用 listCards 或 listSources 访问卡片。但是,我可以使用paymentMethods.list访问它们。

附卡使用:

// server
const attachSource = async (customerId: string, source: string) =>
   await stripe.customers.createSource(customerId, { source });

列出卡片:

// server
export const listCards = async (customerId: string, limit?: number) =>
    await stripe.customers.listCards(customerId, { limit });

证据: 在此处输入图像描述

我的 Stripe 仪表板不显示 Sources 部分;通过 top 方法添加的卡片出现在卡片部分。

上下文:具有可调用 Firebase 云功能的节点服务器与条带 v3 节点客户端对话。

标签: node.jsgoogle-cloud-functionsstripe-payments

解决方案


推荐阅读