0
votes

I'm using the Stripe Connect API with Managed Accounts to distribute payments to service providers on my app.

Our app would like to take 20% of each charge, and then distribute the rest to the service provider.

I know I can take the full amount of a charge and send it to a managed account, like so:

\Stripe\Stripe::setApiKey('sk_live_xxxxxx');

$charge = \Stripe\Charge::create(array(
     "amount" => (int) $payment,
     "currency" => "usd",
     "customer" => $customerID,
     "destination" => $providerID
));

But is there a way to only send 80% (or any partial amount) of a payment to the destination account, keeping the rest in our umbrella account? I really don't want to have to charge a customer's card twice just to facilitate this model.

1

1 Answers

2
votes

When creating a charge with Connect, you choose your platform's fee with the application_fee parameter. So you can do something like this:

$amount = 1000;  // amount in cents
$application_fee = intval($amount * 0.2);  // 20% of the amount

$charge = \Stripe\Charge::create(array(
    "amount" => $amount,
    "currency" => "usd",
    "customer" => $customerID,
    "destination" => $providerID,
    "application_fee" => $application_fee,
));