calculation updated for credit card.

This commit is contained in:
Kishan Patel 2022-06-23 12:03:57 +05:30
parent 203f6184bf
commit c30616fc46

View File

@ -88,8 +88,18 @@ class CreditCard
{
$payment_hash = PaymentHash::whereRaw('BINARY `hash`= ?', [$request->input('payment_hash')])->firstOrFail();
$amount_with_fee = $payment_hash->data->total->amount_with_fee;
$fee_total = ( 3 * $amount_with_fee) / 100;
$amount_with_fee = $amount_with_fee + $fee_total;
$invoice_totals = $payment_hash->data->total->invoice_totals;
$fee_total = 0;
print_r($payment_hash->data->total);
for ($i = ($invoice_totals * 100) ; $i < ($amount_with_fee * 100); $i++) {
$calculated_fee = ( 3 * $i) / 100;
$calculated_amount_with_fee = round(($i + $calculated_fee) / 100,2);
if ($calculated_amount_with_fee == $amount_with_fee) {
$fee_total = round($calculated_fee / 100,2);
$amount_with_fee = $calculated_amount_with_fee;
break;
}
}
try {
$curl = curl_init();