I am building an application that allows (potentially anonymous) users to send money to a third-party. It is a requirement that the money go directly and not touch the app's account. Stripe's Connect platform seems to allow this, by the third-party connecting an account: https://stripe.com/docs/connect/payments-fees
The "Charge Directly" option seems to do as desired. However, my current implementation seems to be sending the money to my platform's account instead of the third-party connected account. I am using Ruby, so this format applies:
Stripe.api_key = PLATFORM_SECRET_KEY
Stripe::Charge.create({
:amount => 1000,
:currency => "usd",
:source => {TOKEN}
}, {:stripe_account => CONNECTED_STRIPE_ACCOUNT_ID})
The TOKEN
is obtained via Stripe.js from the user inputting their credit card information. I have substituted the PLATFORM_SECRET_KEY
variable for the secret key obtained in my platform's Stripe account under API keys. I have stored the third-party's user_id
from when they connected their account via Stripe Connect, which I input for CONNECTED_STRIPE_ACCOUNT_ID
.
As the payments are showing up in my platform's dashboard under 'Payments', I clearly have some keys mixed up. Can anyone point me in the right direction for which keys go where? Thank you!