Working on gateway fees

This commit is contained in:
Hillel Coren 2017-03-16 22:58:31 +02:00
parent be6c9035aa
commit fb09a38efa
3 changed files with 4 additions and 11 deletions

View File

@ -855,9 +855,7 @@ class BasePaymentDriver
$label = trans('texts.payment_type_on_file', ['type' => $paymentMethod->payment_type->name]); $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 .= $this->invoice()->present()->gatewayFee($paymentMethod->payment_type->gateway_type_id);
$label .= ' - ' . $fee;
}
$links[] = [ $links[] = [
'url' => $url, 'url' => $url,
@ -891,9 +889,7 @@ class BasePaymentDriver
$label = trans("texts.{$gatewayTypeAlias}"); $label = trans("texts.{$gatewayTypeAlias}");
} }
if ($fee = $this->invoice()->present()->gatewayFee($gatewayTypeId)) { $label .= $this->invoice()->present()->gatewayFee($gatewayTypeId);
$label .= ' - ' . $fee;
}
$links[] = [ $links[] = [
'gatewayTypeId' => $gatewayTypeId, 'gatewayTypeId' => $gatewayTypeId,

View File

@ -277,6 +277,6 @@ class InvoicePresenter extends EntityPresenter
$label = trans('texts.fee'); $label = trans('texts.fee');
} }
return $fee . ' ' . $label; return ' - ' . $fee . ' ' . $label;
} }
} }

View File

@ -123,10 +123,7 @@
@if (count($paymentTypes) > 1) @if (count($paymentTypes) > 1)
{!! DropdownButton::success(trans('texts.pay_now'))->withContents($paymentTypes)->large() !!} {!! DropdownButton::success(trans('texts.pay_now'))->withContents($paymentTypes)->large() !!}
@elseif (count($paymentTypes) == 1) @elseif (count($paymentTypes) == 1)
<a href='{!! $paymentURL !!}' class="btn btn-success btn-lg">{{ trans('texts.pay_now') }}</a> <a href='{!! $paymentURL !!}' class="btn btn-success btn-lg">{{ trans('texts.pay_now') }} {{ $invoice->present()->gatewayFee($gatewayTypeId) }}</a>
@if ($fee = $invoice->present()->gatewayFee($gatewayTypeId))
<div class="help-block">{{ $fee }}</div>
@endif
@endif @endif
@else @else
{!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!} {!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}