From 4d4406a8b786f166fb0c60683a42336231b55308 Mon Sep 17 00:00:00 2001 From: Khushboo Date: Mon, 16 Sep 2024 15:44:06 +0200 Subject: [PATCH] Solving the issue of inconsistency of Order state and status field after OFFER_CLOSE notification is processed (#2727) --- Helper/Webhook/OfferClosedWebhookHandler.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Helper/Webhook/OfferClosedWebhookHandler.php b/Helper/Webhook/OfferClosedWebhookHandler.php index ca9f8a796..9695736d7 100644 --- a/Helper/Webhook/OfferClosedWebhookHandler.php +++ b/Helper/Webhook/OfferClosedWebhookHandler.php @@ -105,7 +105,10 @@ public function handleWebhook(MagentoOrder $order, Notification $notification, s } // Move the order from PAYMENT_REVIEW to NEW, so that it can be cancelled - if (!$order->canCancel() && $this->configHelper->getNotificationsCanCancel($order->getStoreId())) { + if (!$order->isCanceled() + && !$order->canCancel() + && $this->configHelper->getNotificationsCanCancel($order->getStoreId()) + ) { $order->setState(MagentoOrder::STATE_NEW); }