Skip to content

Commit

Permalink
Fix changing order status when transaction initially failed
Browse files Browse the repository at this point in the history
ISSUE: CS-6339
  • Loading branch information
AleksandarBoljanovic committed Dec 5, 2024
1 parent ad99fba commit aa24443
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/classes/Services/Integration/OrderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit aa24443

Please sign in to comment.