From 0a4a1872ff50a77b55ef3a349783de1c92365ef2 Mon Sep 17 00:00:00 2001 From: khushboos Date: Mon, 2 Sep 2024 12:30:50 +0530 Subject: [PATCH] Solving the issue of inconsistency of Order state and status field after OFFER_CLOSE notification is processed --- 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); }