1
votes

The scenario is there are 3 users in our website, Admin, Sender and Receiver. Sender send payments to Receiver, but in our website Sender not directly send the payment to Receiver, the amount holds on Admin Stripe account and after the confirmation Receiver receive the payment from Admin Stripe account. For this process I create a platform from Admin Stripe Account , now Sender and Receiver both are connected to that platform.

Below are the codes we are using:

Sender Send Payment To Admin Strip Account

\Stripe\Stripe::setApiKey("sk_test_ADMIN_KEY");

\Stripe\Charge::create(array(
  "amount" => 400,
  "currency" => "usd",
  "source" => "tok_18uL5yIXv4Heg2KDdPHJFo8A", // obtained with Stripe.js
  "description" => "Charge for [email protected]"
));

Receiver Receive Payment From Admin Stripe Account

\Stripe\Stripe::setApiKey("sk_test_ADMIN_KEY.....");

\Stripe\Charge::create(array(
  'amount' => 400,
  'currency' => 'usd',
  'source' => $token,
  'destination' => 'acct_...' // 
));

and more all of three users have their stripe accounts, and on test mode all of three have $0 Available Balance. and Amount is not added to Receiver Stripe Account after using the above code.

1

1 Answers

3
votes

When accepting payments on behalf of third-parties, you cannot hold funds on the platform's account ("Admin"). For compliance reasons, you must set the destination account when you create the charge.

\Stripe\Stripe::setApiKey("sk_test_..."); // platform's API key

\Stripe\Charge::create(array(
  'amount' => 400,
  'currency' => 'usd',
  'source' => $token,
  'destination' => 'acct_...' // connected account's ID
));

This will charge the customer (via the payment method in $token) and add the funds to the connected account's balance. Once the funds become available, they can be transferred account to the connected account's associated bank account.

Note that because this charge is created "through the platform" (i.e. with the destination parameter), the platform will pay Stripe's fees and be responsible for chargebacks and refunds (cf. here). Because there is no application_fee parameter, the platform will effectively lose money on this transaction, as it will pay for Stripe's fees but not receive anything.

If you're using managed accounts, then you (as the platform) are also in control of transfers to the associated bank account. You can read more about this here.

With standalone accounts, the platform does not have control over bank transfers -- instead, each standalone account's owner does, via their own account settings.