I have an observer that triggered on sales_order_invoice_pay
event, and after creating the invoice, the order status is automatically changed to complete. after that I try to change it to processing but it doesn't work.
is there any way to change the order status after creating the invoice?
below is the code I use to change the status:
$order->setState(\Magento\Sales\Model\Order::STATE_PROCESSING, true);
$order->setStatus('processing');
$this->_orderRepository->save($order);