diff --git a/app/PaymentDrivers/Authorize/AuthorizeCreditCard.php b/app/PaymentDrivers/Authorize/AuthorizeCreditCard.php index 074619a05582..1e30cfb42d54 100644 --- a/app/PaymentDrivers/Authorize/AuthorizeCreditCard.php +++ b/app/PaymentDrivers/Authorize/AuthorizeCreditCard.php @@ -12,7 +12,6 @@ namespace App\PaymentDrivers\Authorize; -use App\Events\Payment\PaymentWasCreated; use App\Jobs\Util\SystemLogger; use App\Models\ClientGatewayToken; use App\Models\GatewayType; @@ -21,7 +20,6 @@ use App\Models\PaymentHash; use App\Models\PaymentType; use App\Models\SystemLog; use App\PaymentDrivers\AuthorizePaymentDriver; -use App\Utils\Ninja; use App\Utils\Traits\MakesHash; /** @@ -50,7 +48,7 @@ class AuthorizeCreditCard $data['public_client_id'] = $this->authorize->init()->getPublicClientKey(); $data['api_login_id'] = $this->authorize->company_gateway->getConfigField('apiLoginId'); - return render('gateways.authorize.credit_card_payment', $data); + return render('gateways.authorize.credit_card.pay', $data); } public function processPaymentResponse($request) @@ -97,7 +95,6 @@ class AuthorizeCreditCard /*Refactor and push to BaseDriver*/ if ($data['response'] != null && $data['response']->getMessages()->getResultCode() == 'Ok') { - $this->storePayment($payment_hash, $data); $vars = [ @@ -184,7 +181,8 @@ class AuthorizeCreditCard SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_SUCCESS, SystemLog::TYPE_AUTHORIZE, - $this->authorize->client); + $this->authorize->client + ); return redirect()->route('client.payments.show', ['payment' => $this->encodePrimaryKey($payment->id)]); } diff --git a/resources/views/portal/ninja2020/gateways/authorize/credit_card/pay.blade.php b/resources/views/portal/ninja2020/gateways/authorize/credit_card/pay.blade.php new file mode 100644 index 000000000000..4cb169fed924 --- /dev/null +++ b/resources/views/portal/ninja2020/gateways/authorize/credit_card/pay.blade.php @@ -0,0 +1,55 @@ +@extends('portal.ninja2020.layout.payments', ['gateway_title' => ctrans('texts.payment_type_credit_card'), 'card_title' => ctrans('texts.payment_type_credit_card')]) + +@section('gateway_head') + + + + + + + +@endsection + +@section('gateway_content') +
+ @csrf + + + + + + + + + +
+ + + + @component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_type')]) + {{ ctrans('texts.credit_card') }} + @endcomponent + + @include('portal.ninja2020.gateways.includes.payment_details') + + @if($token) + @component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.credit_card')]) + {{ strtoupper($token->meta->brand) }} - **** {{ $token->meta->last4 }} + @endcomponent + + @include('portal.ninja2020.gateways.includes.pay_now', ['id' => 'card_button', 'class' => 'pay_now_button', 'data' => ['id' => $token->hashed_id]]) + @else + @include('portal.ninja2020.gateways.authorize.includes.credit_card') + @include('portal.ninja2020.gateways.includes.pay_now', ['id' => 'card_button']) + @endif +@endsection + +@section('gateway_footer') + @if($gateway->getConfigField('testMode')) + + @else + + @endif + + +@endsection diff --git a/resources/views/portal/ninja2020/gateways/authorize/credit_card_payment.blade.php b/resources/views/portal/ninja2020/gateways/authorize/credit_card_payment.blade.php deleted file mode 100644 index 2996d9e4202e..000000000000 --- a/resources/views/portal/ninja2020/gateways/authorize/credit_card_payment.blade.php +++ /dev/null @@ -1,154 +0,0 @@ -@extends('portal.ninja2020.layout.app') -@section('meta_title', ctrans('texts.payment_type_credit_card')) - -@push('head') - - - - - - -@endpush - -@section('body') -
- @csrf - - - - - - - - - -
-
-
-
- -
-
-

- {{ ctrans('texts.enter_payment') }} -

-
-
- @if($tokens->count() == 0) -
-
-
- {{ ctrans('texts.subtotal') }} -
-
- {{ App\Utils\Number::formatMoney($total['invoice_totals'], $client) }} -
-
- {{ ctrans('texts.gateway_fees') }} -
-
- {{ App\Utils\Number::formatMoney($total['fee_total'], $client) }} -
-
- {{ ctrans('texts.total') }} -
-
- {{ App\Utils\Number::formatMoney($total['amount_with_fee'], $client) }} -
-
- - @include('portal.ninja2020.gateways.authorize.credit_card') - -
-
- {{ ctrans('texts.token_billing_checkbox') }} -
-
- - -
-
-
- -
-
- @else - -
-
-
-
- {{ ctrans('texts.totals') }} -
-
- {{ App\Utils\Number::formatMoney($total['invoice_totals'], $client) }} -
-
- {{ ctrans('texts.gateway_fees') }} -
-
- {{ App\Utils\Number::formatMoney($total['fee_total'], $client) }} -
-
- {{ ctrans('texts.amount') }} -
-
- {{ App\Utils\Number::formatMoney($total['amount_with_fee'], $client) }} -
-
- @foreach($tokens as $token) -
-
- {{ $token->meta->brand }} : {{ $token->meta->last4 }} -
-
- -
-
- @endforeach - -
-
- - @endif -
-
-
-
-
-@endsection - -@push('footer') - - @if($gateway->getConfigField('testMode')) - - @else - - @endif - - -@endpush \ No newline at end of file diff --git a/resources/views/portal/ninja2020/gateways/authorize/includes/credit_card.blade.php b/resources/views/portal/ninja2020/gateways/authorize/includes/credit_card.blade.php index 97431422c836..1d2f75c7e4db 100644 --- a/resources/views/portal/ninja2020/gateways/authorize/includes/credit_card.blade.php +++ b/resources/views/portal/ninja2020/gateways/authorize/includes/credit_card.blade.php @@ -1,10 +1,12 @@ -
+
- - - - - + + + + +
+
-
\ No newline at end of file +
diff --git a/resources/views/portal/ninja2020/gateways/includes/pay_now.blade.php b/resources/views/portal/ninja2020/gateways/includes/pay_now.blade.php index bb43731892d5..ea005a0cb8cd 100644 --- a/resources/views/portal/ninja2020/gateways/includes/pay_now.blade.php +++ b/resources/views/portal/ninja2020/gateways/includes/pay_now.blade.php @@ -1,9 +1,10 @@
-