0

This is my code

$apiKey = 'xxxxxxxxxxxxxxxxxxxx';
$payload = [
    'code' => $result['paymentInvoice'],
    'amount' => $result['productPrice'],
];

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_FRESH_CONNECT  => true,
    CURLOPT_URL            => 'https://xxxxxxxx/api/merchant/fee-calculator?'.http_build_query($payload),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HEADER         => false,
    CURLOPT_HTTPHEADER     => ['Authorization: Bearer '.$apiKey],
    CURLOPT_FAILONERROR    => false,
    CURLOPT_IPRESOLVE      => CURL_IPRESOLVE_V4
]);

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

echo empty($error) ? $response : $error;

and here is the response {"success":true,"message":"","data":[{"code":"BCAVA","name":"BCA Virtual Account","fee":{"flat":5500,"percent":"0.00","min":null,"max":null},"total_fee":{"merchant":0,"customer":5500}}]}

my question is how to echo the "5500" on total_fee of customer

zzzz
  • 1
  • 1

0 Answers0