From 55438a5218729641c47077c5f81af3d79454aca3 Mon Sep 17 00:00:00 2001 From: Jackie Date: Mon, 20 Apr 2020 23:02:01 +1200 Subject: [PATCH 1/3] Fixing Issues when creating orders --- Controller/Payment/Response.php | 10 +++------- etc/module.xml | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Controller/Payment/Response.php b/Controller/Payment/Response.php index 5777570..c2ae949 100644 --- a/Controller/Payment/Response.php +++ b/Controller/Payment/Response.php @@ -166,10 +166,6 @@ public function execute() } $this->laybuy->cancelMagentoOrder($order, $token, $message); - if ($order->canCancel()) { - $order->cancel(); - } - return $this->_redirect('checkout/cart', ['_secure' => true]); } @@ -184,10 +180,10 @@ public function execute() if (!isset($orderId) || isset($order) && !$order->getId()) { $this->laybuy->laybuyCancel($token); - } - if($laybuyOrder = $this->laybuy->laybuyCheckOrder($merchantReference)) { - $this->laybuy->refundLaybuy($laybuyOrder->orderId, $laybuyOrder->amount, $quote->getStoreId()); + if($laybuyOrder = $this->laybuy->laybuyCheckOrder($merchantReference)) { + $this->laybuy->refundLaybuy($laybuyOrder->orderId, $laybuyOrder->amount, $quote->getStoreId()); + } } return $this->_redirect('checkout/cart', ['_secure' => true]); diff --git a/etc/module.xml b/etc/module.xml index fc13404..afc006b 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -5,7 +5,7 @@ */ --> - + From 30e11f6701b79c837c7edb75ba16a07a3f84479e Mon Sep 17 00:00:00 2001 From: jackie-od Date: Mon, 2 Aug 2021 02:22:34 +1200 Subject: [PATCH 2/3] Adding Logo to Payment Selection on Checkout --- view/frontend/web/css/source/_module.less | 10 ++++++++++ view/frontend/web/template/payment/laybuy.html | 2 ++ 2 files changed, 12 insertions(+) diff --git a/view/frontend/web/css/source/_module.less b/view/frontend/web/css/source/_module.less index 6c83c04..41d48fb 100644 --- a/view/frontend/web/css/source/_module.less +++ b/view/frontend/web/css/source/_module.less @@ -121,6 +121,16 @@ } } +.checkout-payment-method{ + .payment-method-title { + .laybuy-payment-icon { + max-height:30px; + float:right; + margin-right:20px; + } + } +} + // // Mobile @screen__m //-------------------------------------- diff --git a/view/frontend/web/template/payment/laybuy.html b/view/frontend/web/template/payment/laybuy.html index e4702d4..8c9e3cb 100644 --- a/view/frontend/web/template/payment/laybuy.html +++ b/view/frontend/web/template/payment/laybuy.html @@ -11,6 +11,8 @@ class="radio" data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()" /> +
From 882ab334186a0f62ebcb379f3c253e943160637f Mon Sep 17 00:00:00 2001 From: jackie-od Date: Mon, 2 Aug 2021 14:07:35 +1200 Subject: [PATCH 3/3] Update Response.php Changing back response.php code --- Controller/Payment/Response.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Controller/Payment/Response.php b/Controller/Payment/Response.php index c2ae949..5777570 100644 --- a/Controller/Payment/Response.php +++ b/Controller/Payment/Response.php @@ -166,6 +166,10 @@ public function execute() } $this->laybuy->cancelMagentoOrder($order, $token, $message); + if ($order->canCancel()) { + $order->cancel(); + } + return $this->_redirect('checkout/cart', ['_secure' => true]); } @@ -180,10 +184,10 @@ public function execute() if (!isset($orderId) || isset($order) && !$order->getId()) { $this->laybuy->laybuyCancel($token); + } - if($laybuyOrder = $this->laybuy->laybuyCheckOrder($merchantReference)) { - $this->laybuy->refundLaybuy($laybuyOrder->orderId, $laybuyOrder->amount, $quote->getStoreId()); - } + if($laybuyOrder = $this->laybuy->laybuyCheckOrder($merchantReference)) { + $this->laybuy->refundLaybuy($laybuyOrder->orderId, $laybuyOrder->amount, $quote->getStoreId()); } return $this->_redirect('checkout/cart', ['_secure' => true]);