From b3f97060446054755b0d7a7ef154c8f8cc283bc5 Mon Sep 17 00:00:00 2001 From: Gytautas Date: Mon, 18 Nov 2024 14:47:58 +0200 Subject: [PATCH 1/2] PIPRES-483 canceled payment error handling --- controllers/front/return.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/controllers/front/return.php b/controllers/front/return.php index d5c664310..76c1b308e 100644 --- a/controllers/front/return.php +++ b/controllers/front/return.php @@ -107,7 +107,12 @@ public function initContent() } if (false === $data['mollie_info']) { $data['mollie_info'] = []; - $data['msg_details'] = $this->module->l('There is no order with this ID.', self::FILE_NAME); + $logger->error(sprintf('There is no order with this order number - %s', (string) $orderNumber)); + + $data['msg_details'] = $this->module->l('Your payment was not successful. Try again.', self::FILE_NAME); + $this->setWarning($data['msg_details']); + + Tools::redirect(Context::getContext()->link->getPageLink('cart', true)); } elseif (PaymentMethod::BANKTRANSFER === $data['mollie_info']['method'] && PaymentStatus::STATUS_OPEN === $data['mollie_info']['bank_status'] ) { From 0559ef8201f9f945dad1f1202c2bae893cc133fa Mon Sep 17 00:00:00 2001 From: Gytautas Date: Mon, 18 Nov 2024 14:51:36 +0200 Subject: [PATCH 2/2] info log instead of error --- controllers/front/return.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/front/return.php b/controllers/front/return.php index 76c1b308e..18783dc22 100644 --- a/controllers/front/return.php +++ b/controllers/front/return.php @@ -107,7 +107,8 @@ public function initContent() } if (false === $data['mollie_info']) { $data['mollie_info'] = []; - $logger->error(sprintf('There is no order with this order number - %s', (string) $orderNumber)); + //NOTE: information instead of error as this might occur due to cancellation of the payment + $logger->info(sprintf('There is no order with this order number - %s', (string) $orderNumber)); $data['msg_details'] = $this->module->l('Your payment was not successful. Try again.', self::FILE_NAME); $this->setWarning($data['msg_details']);