From df7a5bd4282cde93e3f9e615c46bd3fdfeb66c4a Mon Sep 17 00:00:00 2001 From: denisdulici Date: Thu, 2 Jan 2020 13:15:49 +0300 Subject: [PATCH] payment method update --- app/Abstracts/Http/PaymentController.php | 41 ++++++++----------- .../show.blade.php => hosted.blade.php} | 0 .../payment_method/hosted/signed.blade.php | 15 ------- .../show.blade.php => redirect.blade.php} | 0 .../payment_method/redirect/signed.blade.php | 28 ------------- 5 files changed, 18 insertions(+), 66 deletions(-) rename resources/views/partials/portal/payment_method/{hosted/show.blade.php => hosted.blade.php} (100%) delete mode 100644 resources/views/partials/portal/payment_method/hosted/signed.blade.php rename resources/views/partials/portal/payment_method/{redirect/show.blade.php => redirect.blade.php} (100%) delete mode 100644 resources/views/partials/portal/payment_method/redirect/signed.blade.php diff --git a/app/Abstracts/Http/PaymentController.php b/app/Abstracts/Http/PaymentController.php index b2f72614c..73249847f 100644 --- a/app/Abstracts/Http/PaymentController.php +++ b/app/Abstracts/Http/PaymentController.php @@ -43,12 +43,28 @@ abstract class PaymentController extends BaseController public function show(Invoice $invoice, PaymentRequest $request) { - return $this->getInvoiceShow($invoice, 'show'); + $this->setContactFirstLastName($invoice); + + $confirm_url = $this->getConfirmUrl($invoice); + + $html = view('partials.portal.payment_method.' . $this->type, [ + 'setting' => $this->setting, + 'invoice' => $invoice, + 'confirm_url' => $confirm_url, + ])->render(); + + return response()->json([ + 'code' => $this->setting['code'], + 'name' => $this->setting['name'], + 'description' => trans($this->alias . '::general.description'), + 'redirect' => false, + 'html' => $html, + ]); } public function signed(Invoice $invoice, PaymentRequest $request) { - return $this->getInvoiceShow($invoice, 'signed'); + return $this->show($invoice, $request); } public function cancel(Invoice $invoice, $force_redirect = false) @@ -99,27 +115,6 @@ abstract class PaymentController extends BaseController ]); } - public function getInvoiceShow(Invoice $invoice, $view = 'show') - { - $this->setContactFirstLastName($invoice); - - $confirm_url = $this->getConfirmUrl($invoice); - - $html = view('partials.portal.payment_method.' . $this->type . '.' . $view, [ - 'setting' => $this->setting, - 'invoice' => $invoice, - 'confirm_url' => $confirm_url, - ])->render(); - - return response()->json([ - 'code' => $this->setting['code'], - 'name' => $this->setting['name'], - 'description' => trans($this->alias . '::general.description'), - 'redirect' => false, - 'html' => $html, - ]); - } - public function getInvoiceUrl($invoice) { return $this->user diff --git a/resources/views/partials/portal/payment_method/hosted/show.blade.php b/resources/views/partials/portal/payment_method/hosted.blade.php similarity index 100% rename from resources/views/partials/portal/payment_method/hosted/show.blade.php rename to resources/views/partials/portal/payment_method/hosted.blade.php diff --git a/resources/views/partials/portal/payment_method/hosted/signed.blade.php b/resources/views/partials/portal/payment_method/hosted/signed.blade.php deleted file mode 100644 index 73b1079a3..000000000 --- a/resources/views/partials/portal/payment_method/hosted/signed.blade.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/resources/views/partials/portal/payment_method/redirect/show.blade.php b/resources/views/partials/portal/payment_method/redirect.blade.php similarity index 100% rename from resources/views/partials/portal/payment_method/redirect/show.blade.php rename to resources/views/partials/portal/payment_method/redirect.blade.php diff --git a/resources/views/partials/portal/payment_method/redirect/signed.blade.php b/resources/views/partials/portal/payment_method/redirect/signed.blade.php deleted file mode 100644 index d61f93ceb..000000000 --- a/resources/views/partials/portal/payment_method/redirect/signed.blade.php +++ /dev/null @@ -1,28 +0,0 @@ -
-
- @if (!empty($setting['name'])) -

{{ $setting['name'] }}

- @endif - - @if (!empty($setting['description'])) -
{{ $setting['description'] }}
- @endif -
-
- -
-
- {!! Form::open([ - 'url' => $confirm_url, - 'id' => 'redirect-form', - 'role' => 'form', - 'autocomplete' => "off", - 'novalidate' => 'true' - ]) !!} - - {!! Form::close() !!} -
-
-