Get a list of the charges on a Stripe account connected via Stripe Connect

狂风中的少年 提交于 2019-12-24 17:51:19

问题


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

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.


回答1:


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


来源:https://stackoverflow.com/questions/35411609/get-a-list-of-the-charges-on-a-stripe-account-connected-via-stripe-connect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!