Reputation: 4327
I use stripe library for payment . There is no exception without destination param but when I add this param this exception has occured "The destination param must be a connected account".
Stripe.apiKey = "sk_test_...";
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("amount", 1000);
chargeParams.put("currency", "usd");
chargeParams.put("source", {TOKEN});
chargeParams.put("destination", {CONNECTED_STRIPE_ACCOUNT_ID});
Charge.create(chargeParams);
Sorry for my english.
Upvotes: 2
Views: 1424
Reputation: 17505
When creating a charge through the platform, the destination
parameter must be set to the ID of the account for which you're accepting the payment.
In the example code on Stripe's site and in your question, you must replace {CONNECTED_STRIPE_ACCOUNT_ID}
with the actual account ID. Account IDs are strings that start with acct_
followed by random alphanumeric characters.
If your platform is using standalone accounts, then you get the account ID in the stripe_user_id
parameter in the last step of the OAuth flow.
If your platform is using managed accounts, then you get the account ID when you create an account, in the id
parameter.
Upvotes: 1