$currency = 'cad';
//$customerId = $request->customerId;
$intent = \Stripe\PaymentIntent::create([
'amount' => ($finalAmount *100),
'currency' => $currency,
'customer' => $customerId,
'description' => $description
]);
I Have an app where the seller post products and buyer can buy , During checkout I am charging from buyer (Customers) and after the order status is changed to completed I want to payout to seller but deduct 5% commission from the order amount. This is what I am doing but it send the total amount without the deduction of 5% commission on live Mode, ON the test mode the deduction is okay.
if($commission->commission_type == 'percentage'){
$amount = $totalAmount - (($commission->commission_amount/100)*$totalAmount);
}
$finalAmount = (round( $amount,2));
//Paying to the seller
$transfer = \Stripe\Transfer::create([
"amount" => ($finalAmount*100),
"currency" => "cad",
"destination" => $seller_account,
]);