I have this error when I'm trying to pay an order:
Fatal error: Uncaught TypeError:
Argument 1 passed to Magento\Paypal\Model\Adminhtml\Express::isOrderAuthorizationAllowed() must be an instance of Magento\Sales\Model\Order\Payment, null given,
called in /var/www/axiane-portailclient/vendor/magento/module-paypal/Plugin/OrderCanInvoice.php on line 41 and
defined in /var/www/axiane-portailclient/vendor/magento/module-paypal/Model/Adminhtml/Express.php:169
Stack trace:
#0 /var/www/axiane-portailclient/vendor/magento/module-paypal/Plugin/OrderCanInvoice.php(41): Magento\Paypal\Model\Adminhtml\Express->isOrderAuthorizationAllowed(NULL)
#1 /var/www/axiane-portailclient/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Paypal\Plugin\OrderCanInvoice->afterCanInvoice(Object(Magento\Sales\Model\Order\Interceptor), false)
#2 /var/www/axiane-portailclient/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Sales\Model\Order\Interceptor->Magento\Framework\Interception\{closure}()
#3 /var/www/axiane-portailclient/generated/code/Magento/Sales/Model/Orde in /var/www/axiane-portailclient/vendor/magento/module-paypal/Model/Adminhtml/Express.php on line 169
I don't know why, because it's not a paypal step.
I'm on magento 2.2.5
Error is showing after save($order)
public function updateOrderStatus(){
$increment_id = $this->loadOrderIncrementId();
$order = $this->_order->loadByIncrementId($increment_id);
$order->setState(Order::STATE_COMPLETE);
$order->setStatus(Order::STATE_COMPLETE);
$this->_orderRepository->save($order);
}