mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
calculation updated for credit card.
This commit is contained in:
parent
203f6184bf
commit
c30616fc46
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user