From 8040b0a8f99bbab474e163d38df78dee07064f3d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 27 Jul 2021 14:03:04 +1000 Subject: [PATCH] eWay Process Payment --- app/PaymentDrivers/Eway/CreditCard.php | 7 +- .../gateways/eway/authorize.blade.php | 290 +---------------- .../eway/includes/credit_card.blade.php | 304 +++++++++++++++++- .../ninja2020/gateways/eway/pay.blade.php | 94 ++++++ 4 files changed, 391 insertions(+), 304 deletions(-) create mode 100644 resources/views/portal/ninja2020/gateways/eway/pay.blade.php diff --git a/app/PaymentDrivers/Eway/CreditCard.php b/app/PaymentDrivers/Eway/CreditCard.php index a04aea1a4cfd..c656ec8b0922 100644 --- a/app/PaymentDrivers/Eway/CreditCard.php +++ b/app/PaymentDrivers/Eway/CreditCard.php @@ -157,7 +157,7 @@ class CreditCard $payment_meta->exp_month = $response->Customer->CardDetails->ExpiryMonth; $payment_meta->exp_year = $response->Customer->CardDetails->ExpiryYear; $payment_meta->brand = 'CC'; - $payment_meta->last4 = $response->Customer->CardDetails->Number; + $payment_meta->last4 = substr($response->Customer->CardDetails->Number, -4);; $payment_meta->type = GatewayType::CREDIT_CARD; $cgt['payment_meta'] = $payment_meta; @@ -171,6 +171,11 @@ class CreditCard public function paymentView($data) { + $data['gateway'] = $this->eway_driver; + $data['public_api_key'] = $this->eway_driver->company_gateway->getConfigField('publicApiKey'); + + return render('gateways.eway.pay', $data); + } public function processPaymentResponse($request) diff --git a/resources/views/portal/ninja2020/gateways/eway/authorize.blade.php b/resources/views/portal/ninja2020/gateways/eway/authorize.blade.php index 1081a9980942..cd41a3b9a283 100644 --- a/resources/views/portal/ninja2020/gateways/eway/authorize.blade.php +++ b/resources/views/portal/ninja2020/gateways/eway/authorize.blade.php @@ -36,122 +36,14 @@ ctrans('texts.credit_card')]) +@include('portal.ninja2020.gateways.eway.includes.credt_card') + @endsection diff --git a/resources/views/portal/ninja2020/gateways/eway/includes/credit_card.blade.php b/resources/views/portal/ninja2020/gateways/eway/includes/credit_card.blade.php index e462c5d42fdf..3d2730fcf759 100644 --- a/resources/views/portal/ninja2020/gateways/eway/includes/credit_card.blade.php +++ b/resources/views/portal/ninja2020/gateways/eway/includes/credit_card.blade.php @@ -1,15 +1,289 @@ -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ \ No newline at end of file diff --git a/resources/views/portal/ninja2020/gateways/eway/pay.blade.php b/resources/views/portal/ninja2020/gateways/eway/pay.blade.php new file mode 100644 index 000000000000..e58ffcabc759 --- /dev/null +++ b/resources/views/portal/ninja2020/gateways/eway/pay.blade.php @@ -0,0 +1,94 @@ +@extends('portal.ninja2020.layout.payments', ['gateway_title' => ctrans('texts.credit_card'), 'card_title' => ctrans('texts.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') + + @component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.pay_with')]) + @if(count($tokens) > 0) + @foreach($tokens as $token) + + @endforeach + @endisset + + + @endcomponent + +
+ + + @include('portal.ninja2020.gateways.includes.save_card') +
+ + + + @include('portal.ninja2020.gateways.includes.pay_now') +@endsection + +@section('gateway_footer') + + @include('portal.ninja2020.gateways.eway.includes.credit_card') + + + + + +@endsection