From 5c90c873e6bb5ca02f2847af50b3e3ae2cb9c38a Mon Sep 17 00:00:00 2001
From: Tigran <62335544+tikohov20@users.noreply.github.com>
Date: Wed, 13 Dec 2023 15:51:48 +0400
Subject: [PATCH] [PT-728] Order state processing when order is confirmed.
(#95)
---
Observer/AfterPlaceOrder.php | 9 +++++++--
composer.json | 2 +-
etc/adminhtml/system.xml | 5 -----
etc/module.xml | 2 +-
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/Observer/AfterPlaceOrder.php b/Observer/AfterPlaceOrder.php
index 48b803e..c6dec8e 100644
--- a/Observer/AfterPlaceOrder.php
+++ b/Observer/AfterPlaceOrder.php
@@ -2,6 +2,7 @@
namespace Mondu\Mondu\Observer;
use Magento\Framework\Event\Observer;
+use Magento\Sales\Model\Order;
use Mondu\Mondu\Helpers\ContextHelper;
use Mondu\Mondu\Helpers\Logger\Logger;
use Mondu\Mondu\Helpers\PaymentMethod;
@@ -45,8 +46,12 @@ public function _execute(Observer $observer)
$order->addStatusHistoryComment(
__('Mondu: Order Status changed to Payment Review because it needs manual confirmation')
);
- $order->setState(\Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW);
- $order->setStatus(\Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW);
+ $order->setState(Order::STATE_PAYMENT_REVIEW);
+ $order->setStatus(Order::STATE_PAYMENT_REVIEW);
+ $order->save();
+ } else {
+ $order->setState(Order::STATE_PROCESSING);
+ $order->setStatus(Order::STATE_PROCESSING);
$order->save();
}
}
diff --git a/composer.json b/composer.json
index 681fe5f..11b064f 100644
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,7 @@
"name": "mondu_gmbh/magento2-payment",
"description": "Mondu payment method for magento 2",
"type": "magento2-module",
- "version": "2.2.2",
+ "version": "2.3.0",
"license": [
"MIT"
],
diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml
index 288cf88..60dfac5 100644
--- a/etc/adminhtml/system.xml
+++ b/etc/adminhtml/system.xml
@@ -103,11 +103,6 @@
payment/monduinstallmentbyinvoice/description
-
-
- Magento\Sales\Model\Config\Source\Order\Status\NewStatus
- payment/mondu/order_status
-
diff --git a/etc/module.xml b/etc/module.xml
index bf5d2e7..fa215c6 100755
--- a/etc/module.xml
+++ b/etc/module.xml
@@ -1,6 +1,6 @@
-
+