From fb09a38efa1444ce3b04b08a011a5473c9669230 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 16 Mar 2017 22:58:31 +0200 Subject: [PATCH] Working on gateway fees --- app/Ninja/PaymentDrivers/BasePaymentDriver.php | 8 ++------ app/Ninja/Presenters/InvoicePresenter.php | 2 +- resources/views/invoices/view.blade.php | 5 +---- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/app/Ninja/PaymentDrivers/BasePaymentDriver.php b/app/Ninja/PaymentDrivers/BasePaymentDriver.php index 6cb72bde4906..7818d018283e 100644 --- a/app/Ninja/PaymentDrivers/BasePaymentDriver.php +++ b/app/Ninja/PaymentDrivers/BasePaymentDriver.php @@ -855,9 +855,7 @@ class BasePaymentDriver $label = trans('texts.payment_type_on_file', ['type' => $paymentMethod->payment_type->name]); } - if ($fee = $this->invoice()->present()->gatewayFee($paymentMethod->payment_type->gateway_type_id)) { - $label .= ' - ' . $fee; - } + $label .= $this->invoice()->present()->gatewayFee($paymentMethod->payment_type->gateway_type_id); $links[] = [ 'url' => $url, @@ -891,9 +889,7 @@ class BasePaymentDriver $label = trans("texts.{$gatewayTypeAlias}"); } - if ($fee = $this->invoice()->present()->gatewayFee($gatewayTypeId)) { - $label .= ' - ' . $fee; - } + $label .= $this->invoice()->present()->gatewayFee($gatewayTypeId); $links[] = [ 'gatewayTypeId' => $gatewayTypeId, diff --git a/app/Ninja/Presenters/InvoicePresenter.php b/app/Ninja/Presenters/InvoicePresenter.php index 99693c97e17c..e34016f11f79 100644 --- a/app/Ninja/Presenters/InvoicePresenter.php +++ b/app/Ninja/Presenters/InvoicePresenter.php @@ -277,6 +277,6 @@ class InvoicePresenter extends EntityPresenter $label = trans('texts.fee'); } - return $fee . ' ' . $label; + return ' - ' . $fee . ' ' . $label; } } diff --git a/resources/views/invoices/view.blade.php b/resources/views/invoices/view.blade.php index f7aae7708bf8..24abba4e49c2 100644 --- a/resources/views/invoices/view.blade.php +++ b/resources/views/invoices/view.blade.php @@ -123,10 +123,7 @@ @if (count($paymentTypes) > 1) {!! DropdownButton::success(trans('texts.pay_now'))->withContents($paymentTypes)->large() !!} @elseif (count($paymentTypes) == 1) - {{ trans('texts.pay_now') }} - @if ($fee = $invoice->present()->gatewayFee($gatewayTypeId)) -
{{ $fee }}
- @endif + {{ trans('texts.pay_now') }} {{ $invoice->present()->gatewayFee($gatewayTypeId) }} @endif @else {!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}