Stripe - How to charge one managed account and set destination as another managed account

533 Views Asked by At

I have 2 managed accounts say A and B and when a credit card is charged, the charge is moved to the managed Account A. Now, I need to move a portion of the amount to Managed Account B at a later point of time. I looked at the link https://stripe.com/docs/connect/payments-fees that provides the following info

Charging through the platform

The second way to perform a charge on behalf of a connected account is to create it on your platform’s Stripe account and use the destination parameter–specifying the connected account ID–in the charge request.

Stripe.apiKey = PLATFORM_SECRET_KEY;

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);

But, I am unable to set the token paramater for the source

The documentation states that we use the publishable key of the Managed Account B to create a token. But, I am not getting how to generate the token this way. How do I generate this token? or is there another way to make this type of charge?

0

There are 0 best solutions below