i would like to set order to complete programmatically after they have been processed in another software. This is the typical code i found all over the internet:
$orderId = 1000120319; $order = $objectManager->create('\Magento\Sales\Model\Order') ->load($orderId); $orderState = \Magento\Sales\Model\Order::STATE_COMPLETE; $order->setState($orderState)->setStatus($orderState); $order->save();
All i get is this result:
Uncaught Magento\Framework\Exception\LocalizedException: Please provide payment for the order.
What i have to do, to set the payment completed as well? Thanks for your help in advanced