From 132f9da3ffbcb3773fe01a7d172861c482694fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Wed, 6 Jan 2021 13:06:18 +0100 Subject: [PATCH] Pass GatewayType from gateway_type_id on token --- app/Services/Invoice/AutoBillInvoice.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/Services/Invoice/AutoBillInvoice.php b/app/Services/Invoice/AutoBillInvoice.php index 3f92130af077..86743bea4970 100644 --- a/app/Services/Invoice/AutoBillInvoice.php +++ b/app/Services/Invoice/AutoBillInvoice.php @@ -14,9 +14,7 @@ namespace App\Services\Invoice; use App\DataMapper\InvoiceItem; use App\Events\Payment\PaymentWasCreated; use App\Factory\PaymentFactory; -use App\Models\Client; use App\Models\Credit; -use App\Models\GatewayType; use App\Models\Invoice; use App\Models\Payment; use App\Models\PaymentHash; @@ -83,7 +81,7 @@ class AutoBillInvoice extends AbstractService } /* $gateway fee */ - $fee = $gateway_token->gateway->calcGatewayFee($amount, GatewayType::CREDIT_CARD, $this->invoice->uses_inclusive_taxes); + $fee = $gateway_token->gateway->calcGatewayFee($amount, $gateway_token->gateway_type_id, $this->invoice->uses_inclusive_taxes); //todo determine exact fee as per PaymentController