【问题标题】:List all charges of a Connected Stripe Account列出 Connected Stripe 账户的所有费用
【发布时间】:2021-06-16 09:37:14
【问题描述】:

我有带连接的条带帐户的条带平台。

我想获得对特定关联帐户的所有费用。

用户关联的帐号 ID:

acct_xxx

我能找到的唯一文档是基于 API 密钥检索到的客户。 https://stripe.com/docs/api/charges/list

const stripe = require('stripe')('sk_test_xxx');

const charges = await stripe.charges.list({
  limit: 3,
});

我需要获取关联帐户的所有费用。不对平台客户收费。

我为 ruby​​ 发现了一个类似的堆栈溢出问题。 Get a list of the charges on a Stripe account connected via Stripe Connect

我不知道如何使用 node.js 实现这一点

【问题讨论】:

    标签: node.js google-cloud-functions stripe-payments


    【解决方案1】:

    您需要传递 Stripe-Account 标头以“在 Connect 帐户上”进行 API 调用:https://stripe.com/docs/connect/authentication#stripe-account-header

    Stripe 的大多数客户端库(如 stripe-node)允许在选项哈希中为每个 API 调用函数传递一个参数,例如:

    const charges = await stripe.charges.list(
      {
        limit: 3,
      },
      {
        stripeAccount: 'acct_12345'
      }
    );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-14
      • 2023-03-27
      • 2020-12-15
      • 1970-01-01
      • 2021-03-02
      • 1970-01-01
      • 2021-01-06
      • 1970-01-01
      相关资源
      最近更新 更多