Skip to content

Instantly share code, notes, and snippets.

@jordanvector
Created August 4, 2022 01:08
Show Gist options
  • Save jordanvector/9b914b5d878a88cfa0c1d7e460e657b7 to your computer and use it in GitHub Desktop.
Save jordanvector/9b914b5d878a88cfa0c1d7e460e657b7 to your computer and use it in GitHub Desktop.
Adyen-complete-state-fix
From 7c19731c9548784f1287bacda56c9a1a30dc1004 Mon Sep 17 00:00:00 2001
From: Jordan Schinella <[email protected]>
Date: Wed, 3 Aug 2022 21:04:26 -0400
Subject: [PATCH] fix completed order state change in finalizeOrder method
---
Helper/Order.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Helper/Order.php b/Helper/Order.php
index 5a4f34d..8f6d37c 100644
--- a/Helper/Order.php
+++ b/Helper/Order.php
@@ -299,6 +299,9 @@ class Order extends AbstractHelper
// Else add comment
if (!empty($status) && $maintainingState) {
$order->addStatusHistoryComment(__($comment), $status);
+ if (strcmp($order->getState(), MagentoOrder::STATE_NEW) == 0) {
+ $order->setState(MagentoOrder::STATE_PROCESSING);
+ }
$this->adyenLogger->addAdyenNotificationCronjob(
'Maintaining current status: ' . $status,
$this->adyenOrderPaymentHelper->getLogOrderContext($order)
--
2.37.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment