From 79ca7978871e4fc764d1b316998ba4eccfd0e93e Mon Sep 17 00:00:00 2001 From: woutse Date: Mon, 23 Jan 2023 14:29:36 +0100 Subject: [PATCH] Failover update --- Controller/Checkout/Exchange.php | 3 +-- Controller/Checkout/Finish.php | 2 +- Observer/ShipmentSaveAfter.php | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Controller/Checkout/Exchange.php b/Controller/Checkout/Exchange.php index 82b82dc2..27caeb39 100644 --- a/Controller/Checkout/Exchange.php +++ b/Controller/Checkout/Exchange.php @@ -11,7 +11,6 @@ use Paynl\Payment\Helper\PayHelper; use Paynl\Payment\Model\PayPayment; use Paynl\Transaction; -use Paynl\Config as PAYSDK; /** * Communicates with PAY. in order to update payment statuses in magento @@ -131,9 +130,9 @@ public function execute() } $this->config->setStore($order->getStore()); - PAYSDK::setApiToken($this->config->getApiToken()); try { + $this->config->configureSDK(); $transaction = Transaction::get($payOrderId); } catch (\Exception $e) { payHelper::logCritical($e, $params, $order->getStore()); diff --git a/Controller/Checkout/Finish.php b/Controller/Checkout/Finish.php index 28605911..54a4c7fb 100644 --- a/Controller/Checkout/Finish.php +++ b/Controller/Checkout/Finish.php @@ -121,7 +121,6 @@ public function execute() $this->checkEmpty($order, 'order', 1013); $this->config->setStore($order->getStore()); - \Paynl\Config::setApiToken($this->config->getApiToken()); $payment = $order->getPayment(); $information = $payment->getAdditionalInformation(); @@ -137,6 +136,7 @@ public function execute() } if (empty($bSuccess) && !$isPinTransaction) { + $this->config->configureSDK(); $transaction = \Paynl\Transaction::get($payOrderId); $orderNumber = $transaction->getExtra1(); $this->checkEmpty($order->getIncrementId() == $orderNumber, '', 104, 'order mismatch'); diff --git a/Observer/ShipmentSaveAfter.php b/Observer/ShipmentSaveAfter.php index 3f15dfc3..20b32fd1 100644 --- a/Observer/ShipmentSaveAfter.php +++ b/Observer/ShipmentSaveAfter.php @@ -65,7 +65,7 @@ public function execute(\Magento\Framework\Event\Observer $observer) # Handles Picqer # Handles Sherpa # Handles Manual made shipment - \Paynl\Config::setApiToken($this->config->getApiToken()); + $this->config->configureSDK(); $bCaptureResult = \Paynl\Transaction::capture($payOrderId); if ($bCaptureResult) { $transaction = \Paynl\Transaction::get($payOrderId);