diff --git a/Model/Service/Order.php b/Model/Service/Order.php index 889dde04..26912dc6 100644 --- a/Model/Service/Order.php +++ b/Model/Service/Order.php @@ -29,6 +29,7 @@ use Magento\Sales\Model\ResourceModel\Order\CollectionFactory; use Buckaroo\Magento2\Helper\Data; use Magento\Framework\App\ResourceConnection; +use Laminas\Db\Sql\Expression; class Order { @@ -43,16 +44,17 @@ class Order private Factory $configProviderFactory; public function __construct( - Account $accountConfig, - MethodFactory $configProviderMethodFactory, - Factory $configProviderFactory, + Account $accountConfig, + MethodFactory $configProviderMethodFactory, + Factory $configProviderFactory, StoreRepositoryInterface $storeRepository, - CollectionFactory $orderFactory, - OrderStatusFactory $orderStatusFactory, - Data $helper, - Log $logging, - ResourceConnection $resourceConnection - ) { + CollectionFactory $orderFactory, + OrderStatusFactory $orderStatusFactory, + Data $helper, + Log $logging, + ResourceConnection $resourceConnection + ) + { $this->accountConfig = $accountConfig; $this->configProviderMethodFactory = $configProviderMethodFactory; $this->configProviderFactory = $configProviderFactory; @@ -94,11 +96,11 @@ protected function cancelExpiredTransferOrdersPerStore($store) ) ->addFieldToFilter( 'created_at', - ['lt' => new \Zend_Db_Expr('NOW() - INTERVAL ' . $dueDays . ' DAY')] + ['lt' => new Expression('NOW() - INTERVAL ' . $dueDays . ' DAY')] ) ->addFieldToFilter( 'created_at', - ['gt' => new \Zend_Db_Expr('NOW() - INTERVAL ' . ($dueDays + 7) . ' DAY')] + ['gt' => new Expression('NOW() - INTERVAL ' . ($dueDays + 7) . ' DAY')] ); $orderCollection->getSelect() @@ -154,11 +156,11 @@ protected function cancelExpiredPPEOrdersPerStore($store) ) ->addFieldToFilter( 'created_at', - ['lt' => new \Zend_Db_Expr('NOW() - INTERVAL ' . $dueDays . ' DAY')] + ['lt' => new Expression('NOW() - INTERVAL ' . $dueDays . ' DAY')] ) ->addFieldToFilter( 'created_at', - ['gt' => new \Zend_Db_Expr('NOW() - INTERVAL ' . ($dueDays + 7) . ' DAY')] + ['gt' => new Expression('NOW() - INTERVAL ' . ($dueDays + 7) . ' DAY')] ); $orderCollection->getSelect() @@ -216,7 +218,7 @@ public function cancel($order, $statusCode) $this->logging->addDebug(__METHOD__ . '|20|'); if (in_array($order->getPayment()->getMethodInstance()->buckarooPaymentMethodCode, ['klarnakp'])) { - $methodInstanceClass = get_class($order->getPayment()->getMethodInstance()); + $methodInstanceClass = get_class($order->getPayment()->getMethodInstance()); $methodInstanceClass::$requestOnVoid = false; }