Skip to content

Commit 5c90c87

Browse files
authored
[PT-728] Order state processing when order is confirmed. (#95)
1 parent 9e3e113 commit 5c90c87

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

Observer/AfterPlaceOrder.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
namespace Mondu\Mondu\Observer;
33

44
use Magento\Framework\Event\Observer;
5+
use Magento\Sales\Model\Order;
56
use Mondu\Mondu\Helpers\ContextHelper;
67
use Mondu\Mondu\Helpers\Logger\Logger;
78
use Mondu\Mondu\Helpers\PaymentMethod;
@@ -45,8 +46,12 @@ public function _execute(Observer $observer)
4546
$order->addStatusHistoryComment(
4647
__('Mondu: Order Status changed to Payment Review because it needs manual confirmation')
4748
);
48-
$order->setState(\Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW);
49-
$order->setStatus(\Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW);
49+
$order->setState(Order::STATE_PAYMENT_REVIEW);
50+
$order->setStatus(Order::STATE_PAYMENT_REVIEW);
51+
$order->save();
52+
} else {
53+
$order->setState(Order::STATE_PROCESSING);
54+
$order->setStatus(Order::STATE_PROCESSING);
5055
$order->save();
5156
}
5257
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "mondu_gmbh/magento2-payment",
33
"description": "Mondu payment method for magento 2",
44
"type": "magento2-module",
5-
"version": "2.2.2",
5+
"version": "2.3.0",
66
"license": [
77
"MIT"
88
],

etc/adminhtml/system.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@
103103
<label>Installments by Invoice Description</label>
104104
<config_path>payment/monduinstallmentbyinvoice/description</config_path>
105105
</field>
106-
<field id="order_status" translate="label" type="select" sortOrder="13" showInDefault="1" showInWebsite="1" canRestore="1">
107-
<label>New Order Status</label>
108-
<source_model>Magento\Sales\Model\Config\Source\Order\Status\NewStatus</source_model>
109-
<config_path>payment/mondu/order_status</config_path>
110-
</field>
111106
<field id="allowspecific" translate="label" type="allowspecific" sortOrder="14" showInDefault="9"
112107
showInWebsite="1" showInStore="1">
113108
<label>Payment From Applicable Countries</label>

etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
3-
<module name="Mondu_Mondu" setup_version="2.2.2">
3+
<module name="Mondu_Mondu" setup_version="2.3.0">
44
<sequence>
55
<module name="Magento_Sales"/>
66
<module name="Magento_Payment"/>

0 commit comments

Comments
 (0)