<?php
use App\Util\Helper;
use Stripe\StripeClient;

$stripe = new StripeClient('sk_test_4eC39HqLyjWDarjtT1zdp7dc');
$totalAMount = 100;
$vatFee = 0.05;
$stripeFee = 0.039;
$stripeExtraCharge = 1;
$applicationFee = 100;


$checkoutAmount = ($totalAMount + $applicationFee);
$checkoutAmount2 = ($checkoutAmount * $stripeFee) + $checkoutAmount;
$checkoutAmount3 = $checkoutAmount2 + 1;
$checkoutTotal = round(($checkoutAmount3 * $vatFee) + $checkoutAmount3, 0);

$intent = $stripe->paymentIntents->create([
    'amount' => $checkoutTotal,
    'currency' => 'aed',
    'automatic_payment_methods' => ['enabled' => true],
]);
Helper::jsonResult(array('clientSecret' => $intent->client_secret));

?>


