Reputation: 27
Here is my code example:
$create_charge = \Stripe\Charge::create(array(
"amount" => round($total_amount_pass_to_stripe * 100),
"currency" => $currency,
"source" => $_POST['stripeToken'],
"description" => $stripe_description,
"application_fee" => round($application_fee * 100), // amount in cents
), array("stripe_account" => $stripe_user_id));
In above code I've passed amount is $134.82 and application fees is $0.74
Here stripe will calculate charge on total amount as:
134.82 * 0.029 (this is international card rate) + 0.30 = 4.21
Connected account will get 134.82 - 4.21 - 0.74 = 129.87
So what I want to do is:
My connected account should get $130 and my application fees should be $0.74
So what amount should I pass to stripe to work as I expect?
I would appreciate if you could help me to work out.
Thanks in Advance.
Upvotes: 0
Views: 522
Reputation: 17505
You can find the formula you need to use to compute the amount in this support article.
You want the total net amount to be:
$130 + $0.74
= $130.74
so according to the formula, the gross amount needs to be:
($130.74 + $0.30) / (1 - 0.029)
= $131.04 / 0.971
= $134.95
So you need to provide the following values when creating the charge:
amount = 13495
application_fee = 74
Stripe will take its fees as follows:
$134.95 * 0.029 + $0.30
= $3.91 + $0.30
= $4.21
so the connected account will receive:
$134.95 - $4.21 (Stripe's fees) - $0.74 (your application fee)
= $130
and you will receive your application fee: $0.74
Upvotes: 2