stripity-stripe
stripity-stripe copied to clipboard
Retrieve a balance in behalf of another connected account
Hi,
I use stripity_stripe 2.2.1
to build some sort of money marketplace. One user can send certain amount to another one (charge to customer, and money transfer from platform account to connected account). At one point before payout, I need to see actual balance of the connected account. Your function, doesn't allow sending modified headers needed for this request to work out like it's specified in stripe documentation. If I don't specify the Stripe-Account
header I'll always get current balance for platform account.
Same problem appears with some other requests when you need to introduce yourself as connected account, and make eg. transfer to connected account.
For mine purpose I derived a helper function from your Request
module to help me solve the issue. But the question stays the same, how many other functions need this tweak and how can you solve it?
I'm interested in creating a pull request but currently I'm stacked.
alias Stripe.Request
defp retrieve_balance(id) do
[]
|> Request.new_request(%{"Stripe-Account" => id})
|> Request.put_endpoint("balance")
|> Request.put_method(:get)
|> Request.make_request()
end
@pozhega I just created a PR to add this to the documentation, but you should be able to do
Stripe.Balance.retrieve(connect_account: id)
This issue has been automatically marked as "stale:discard". If this issue still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment.
Closing this issue after a prolonged period of inactivity. If this issue is still relevant, feel free to re-open the issue. Thank you!