neurodynamic
neurodynamic

Reputation: 4404

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

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.

Upvotes: 1

Views: 541

Answers (1)

neurodynamic
neurodynamic

Reputation: 4404

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

Upvotes: 2

Related Questions