We will work on Apr 26th (Saturday) and will be off from Apr 30th (Wednesday) until May 2nd (Friday) for public holiday in our country

Commit 9b182736 authored by rikterbeek's avatar rikterbeek

remove old magetno 1.x code

parent deac145c
...@@ -147,9 +147,7 @@ class Result extends \Magento\Framework\App\Action\Action ...@@ -147,9 +147,7 @@ class Result extends \Magento\Framework\App\Action\Action
throw new \Magento\Framework\Exception\LocalizedException(__('Order does not exists with increment_id: %s1', $incrementId)); throw new \Magento\Framework\Exception\LocalizedException(__('Order does not exists with increment_id: %s1', $incrementId));
} }
} else { } else {
Mage::throwException( throw new \Magento\Framework\Exception\LocalizedException(__('Empty merchantReference'));
Mage::helper('adyen')->__('Empty merchantReference')
);
} }
return $result; return $result;
} }
......
...@@ -64,6 +64,11 @@ class Cron ...@@ -64,6 +64,11 @@ class Cron
*/ */
protected $_orderSender; protected $_orderSender;
/**
* @var \Magento\Framework\DB\TransactionFactory
*/
protected $_transactionFactory;
// notification attributes // notification attributes
protected $_pspReference; protected $_pspReference;
...@@ -99,7 +104,8 @@ class Cron ...@@ -99,7 +104,8 @@ class Cron
\Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Framework\Stdlib\DateTime $dateTime,
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
\Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Helper\Data $adyenHelper,
OrderSender $orderSender OrderSender $orderSender,
\Magento\Framework\DB\TransactionFactory $transactionFactory
) )
{ {
$this->_scopeConfig = $scopeConfig; $this->_scopeConfig = $scopeConfig;
...@@ -110,6 +116,7 @@ class Cron ...@@ -110,6 +116,7 @@ class Cron
$this->_localeDate = $localeDate; $this->_localeDate = $localeDate;
$this->_adyenHelper = $adyenHelper; $this->_adyenHelper = $adyenHelper;
$this->_orderSender = $orderSender; $this->_orderSender = $orderSender;
$this->_transactionFactory = $transactionFactory;
} }
...@@ -907,10 +914,13 @@ class Cron ...@@ -907,10 +914,13 @@ class Cron
$shipment->getOrder()->setIsInProcess(true); $shipment->getOrder()->setIsInProcess(true);
$comment = __('Shipment created by Adyen'); $comment = __('Shipment created by Adyen');
$shipment->addComment($comment); $shipment->addComment($comment);
Mage::getModel('core/resource_transaction')
->addObject($shipment) /** @var \Magento\Framework\DB\Transaction $transaction */
$transaction = $this->_transactionFactory->create();
$transaction->addObject($shipment)
->addObject($shipment->getOrder()) ->addObject($shipment->getOrder())
->save(); ->save();
$this->_debugData['_createShipment done'] = 'Order is shipped'; $this->_debugData['_createShipment done'] = 'Order is shipped';
} }
} else { } else {
......
...@@ -136,7 +136,14 @@ class Cc extends \Magento\Payment\Model\Method\Cc ...@@ -136,7 +136,14 @@ class Cc extends \Magento\Payment\Model\Method\Cc
{ {
parent::assignData($data); parent::assignData($data);
$infoInstance = $this->getInfoInstance(); $infoInstance = $this->getInfoInstance();
$infoInstance->setAdditionalInformation('encrypted_data', $data['encrypted_data']);
$this->_adyenLogger
if(isset($data['encrypted_data'])) {
$infoInstance->setAdditionalInformation('encrypted_data', $data['encrypted_data']);
}
$this->_adyenLogger->info("CSE key is set");
return $this; return $this;
} }
...@@ -236,7 +243,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc ...@@ -236,7 +243,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc
break; break;
} }
} else { } else {
$errorMsg = Mage::helper('adyen')->__('The payment is REFUSED by Adyen.'); $errorMsg = __('The payment is REFUSED by Adyen.');
} }
if ($errorMsg) { if ($errorMsg) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment