From aa244437fa13a7aeb5ab1b2227fe9c5e311495b8 Mon Sep 17 00:00:00 2001 From: Aleksandar Sasa Boljanovic Date: Thu, 5 Dec 2024 17:51:30 +0100 Subject: [PATCH] Fix changing order status when transaction initially failed ISSUE: CS-6339 --- src/classes/Services/Integration/OrderService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/classes/Services/Integration/OrderService.php b/src/classes/Services/Integration/OrderService.php index 74209962..a9a933d6 100644 --- a/src/classes/Services/Integration/OrderService.php +++ b/src/classes/Services/Integration/OrderService.php @@ -113,7 +113,9 @@ public function updateOrderStatus(Webhook $webhook, string $statusId): void $this->setTimezone($order->id_shop); if ($order->current_state === AdyenOrderStatusMapping::getPrestaShopOrderStatusId(AdyenOrderStatusMapping::PRESTA_PAYMENT_ERROR) - && !in_array($webhook->getEventCode(), [EventCodes::REFUND, EventCodes::CANCELLATION])) { + && !in_array($webhook->getEventCode(), [EventCodes::REFUND, EventCodes::CANCELLATION]) + && $this->getOrderAmount($webhook->getMerchantReference())->getValue() !== $webhook->getAmount()->getValue() + ) { return; }