Closed ainigma32 closed 11 months ago
Hi @ainigma32 ,
Thank you for reporting this. We will look into it and come back to you later.
Hi @ainigma32 ,
We will add the proposed change in the new version. We'll let you know when it has been released.
Hi @ainigma32 ,
We've introduced a new release where this issue has been fixed: https://github.com/MultiSafepay/magento2/releases/tag/3.1.2
I'm closing this issue for now. Please add a new comment if there are any related comments and we will reopen this if needed.
The cron job sales_clean_orders fails if the order does not contain a valid payment.
The error occurs in MultiSafepay\ConnectCore\Util\PaymentMethodUtil::isMultisafepayOrder(OrderInterface $order): bool When executing the code:
the assumption is made that $order->getPayment() will always return a \Magento\Sales\Api\Data\OrderPaymentInterface
However in the docblock of Magento\Sales\Api\Data\OrderInterface ::getPayment() it says that the return value can also be null.
This occours on Magento 2.4.5-p1 using version 3.1.0 of the MSP plugin
As a workaround we changed the code to: