From 2b7992f427617f362ff5ef95a84971ed0abda7c4 Mon Sep 17 00:00:00 2001 From: woutse Date: Tue, 20 Feb 2024 10:21:34 +0100 Subject: [PATCH] Code polish --- Controller/Checkout/Finish.php | 4 ++-- Model/PayPayment.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Controller/Checkout/Finish.php b/Controller/Checkout/Finish.php index 2d39a75c..082b6e68 100644 --- a/Controller/Checkout/Finish.php +++ b/Controller/Checkout/Finish.php @@ -182,7 +182,7 @@ public function execute() if (empty($successUrl)) { $successUrl = ($payment->getMethod() == 'paynl_payment_paylink' || $this->config->sendEcommerceAnalytics()) ? Config::FINISH_PAY : Config::FINISH_STANDARD; } - $this->payHelper->logDebug('Finish succes,', [$successUrl, $payOrderId, $bSuccess, $bVerify]); + $this->payHelper->logDebug('Finish succes', [$successUrl, $payOrderId, $bSuccess, $bVerify]); $resultRedirect->setPath($successUrl, ['_query' => ['utm_nooverride' => '1']]); if ($isPinTransaction && $pinStatus->getTransactionState() !== 'approved') { $this->messageManager->addNoticeMessage(__('Order has been placed and payment is pending')); @@ -207,7 +207,7 @@ public function execute() } elseif ($this->config->sendEcommerceAnalytics()) { $successUrl = Config::FINISH_PAY; } - $this->payHelper->logDebug('Finish succes,', [$successUrl, $payOrderId]); + $this->payHelper->logDebug('Finish succes', [$successUrl, $payOrderId]); $resultRedirect->setPath($successUrl, ['_query' => ['utm_nooverride' => '1']]); $this->deactivateCart($order, $payOrderId); } else { diff --git a/Model/PayPayment.php b/Model/PayPayment.php index a5feb6bd..3a1f773a 100644 --- a/Model/PayPayment.php +++ b/Model/PayPayment.php @@ -259,7 +259,7 @@ public function processPaidOrder(PayTransaction $transaction, Order $order, $pay $payment->setPreparedMessage('PAY. - '); $payment->setIsTransactionClosed(0); - if ($this->config->getFollowPaymentMethod()) { + if ($this->config->getFollowPaymentMethod() && !empty($paymentProfileId)) { $transactionMethod = $this->config->getPaymentMethod($paymentProfileId); if ($transactionMethod['code'] !== $paymentMethod) { $payment->setMethod($transactionMethod['code']);