获取通过 Stripe Connect 连接的 Stripe 帐户的费用列表 [英] Get a list of the charges on a Stripe account connected via Stripe Connect

查看:36
本文介绍了获取通过 Stripe Connect 连接的 Stripe 帐户的费用列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取已连接的 Stripe 帐户的客户费用列表?

How do you get a list of customer charges on a connected Stripe account?

对于主账户,我使用这个:

For the main account, I use this:

  Stripe::Charge.all(customer: stripe_id).data

但我找不到任何关于在不更改该调用的 Stripe.api_key 的情况下从另一个帐户中收取费用的文档,这似乎是一种糟糕的做法.

But I can't find any documentation on getting charges off of another account without changing the Stripe.api_key for that call alone, which seems like a terrible practice.

推荐答案

答案是将 stripe_account 键添加到 Stripe API 调用的选项哈希中:

The answer is to add the stripe_account key to the options hash of the Stripe API call:

  Stripe::Charge.all(
    { customer: stripe_id },
    stripe_account: connected_account_id
  ).data

这篇关于获取通过 Stripe Connect 连接的 Stripe 帐户的费用列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆