We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) 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
throw new \Magento\Framework\Exception\LocalizedException(__('Order does not exists with increment_id: %s1', $incrementId));
}
} else {
Mage::throwException(
Mage::helper('adyen')->__('Empty merchantReference')
);
throw new \Magento\Framework\Exception\LocalizedException(__('Empty merchantReference'));
}
return $result;
}
......
......@@ -64,6 +64,11 @@ class Cron
*/
protected $_orderSender;
/**
* @var \Magento\Framework\DB\TransactionFactory
*/
protected $_transactionFactory;
// notification attributes
protected $_pspReference;
......@@ -99,7 +104,8 @@ class Cron
\Magento\Framework\Stdlib\DateTime $dateTime,
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
\Adyen\Payment\Helper\Data $adyenHelper,
OrderSender $orderSender
OrderSender $orderSender,
\Magento\Framework\DB\TransactionFactory $transactionFactory
)
{
$this->_scopeConfig = $scopeConfig;
......@@ -110,6 +116,7 @@ class Cron
$this->_localeDate = $localeDate;
$this->_adyenHelper = $adyenHelper;
$this->_orderSender = $orderSender;
$this->_transactionFactory = $transactionFactory;
}
......@@ -907,10 +914,13 @@ class Cron
$shipment->getOrder()->setIsInProcess(true);
$comment = __('Shipment created by Adyen');
$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())
->save();
$this->_debugData['_createShipment done'] = 'Order is shipped';
}
} else {
......
......@@ -136,7 +136,14 @@ class Cc extends \Magento\Payment\Model\Method\Cc
{
parent::assignData($data);
$infoInstance = $this->getInfoInstance();
$this->_adyenLogger
if(isset($data['encrypted_data'])) {
$infoInstance->setAdditionalInformation('encrypted_data', $data['encrypted_data']);
}
$this->_adyenLogger->info("CSE key is set");
return $this;
}
......@@ -236,7 +243,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc
break;
}
} else {
$errorMsg = Mage::helper('adyen')->__('The payment is REFUSED by Adyen.');
$errorMsg = __('The payment is REFUSED by Adyen.');
}
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