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 3941d4be authored by Rik ter Beek's avatar Rik ter Beek Committed by GitHub

Merge pull request #53 from Adyen/develop

Merge 'develop' branch
parents e870ed56 d074fb40
...@@ -40,6 +40,11 @@ class Validate3d extends \Magento\Payment\Block\Form ...@@ -40,6 +40,11 @@ class Validate3d extends \Magento\Payment\Block\Form
* @var \Magento\Checkout\Model\Order * @var \Magento\Checkout\Model\Order
*/ */
protected $_order; protected $_order;
/**
* @var \Magento\Framework\App\RequestInterface
*/
protected $_request;
/** /**
* Validate3d constructor. * Validate3d constructor.
...@@ -53,10 +58,12 @@ class Validate3d extends \Magento\Payment\Block\Form ...@@ -53,10 +58,12 @@ class Validate3d extends \Magento\Payment\Block\Form
\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\View\Element\Template\Context $context,
array $data = [], array $data = [],
\Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Sales\Model\OrderFactory $orderFactory,
\Magento\Checkout\Model\Session $checkoutSession \Magento\Checkout\Model\Session $checkoutSession,
\Magento\Framework\App\RequestInterface $request
) { ) {
$this->_orderFactory = $orderFactory; $this->_orderFactory = $orderFactory;
$this->_checkoutSession = $checkoutSession; $this->_checkoutSession = $checkoutSession;
$this->_request = $request;
parent::__construct($context, $data); parent::__construct($context, $data);
$this->_getOrder(); $this->_getOrder();
} }
...@@ -114,8 +121,18 @@ class Validate3d extends \Magento\Payment\Block\Form ...@@ -114,8 +121,18 @@ class Validate3d extends \Magento\Payment\Block\Form
*/ */
public function getTermUrl() public function getTermUrl()
{ {
return $this->getUrl('adyen/process/validate3d'); return $this->getUrl('adyen/process/validate3d',
['_secure' => $this->_getRequest()->isSecure()]);
} }
/**
* Retrieve request object
*
* @return \Magento\Framework\App\RequestInterface
*/
protected function _getRequest()
{
return $this->_request;
}
} }
\ No newline at end of file
...@@ -35,6 +35,7 @@ class Cron ...@@ -35,6 +35,7 @@ class Cron
*/ */
protected $_logger; protected $_logger;
/** /**
* @var Resource\Notification\CollectionFactory * @var Resource\Notification\CollectionFactory
*/ */
...@@ -570,9 +571,12 @@ class Cron ...@@ -570,9 +571,12 @@ class Cron
// check if order has in invoice only cancel/hold if this is not the case // check if order has in invoice only cancel/hold if this is not the case
if ($ignoreHasInvoice || !$this->_order->hasInvoices()) { if ($ignoreHasInvoice || !$this->_order->hasInvoices()) {
$this->_order->setActionFlag($orderStatus, true);
if ($orderStatus == \Magento\Sales\Model\Order::STATE_HOLDED) { if ($orderStatus == \Magento\Sales\Model\Order::STATE_HOLDED) {
// Allow magento to hold order
$this->_order->setActionFlag(\Magento\Sales\Model\Order::ACTION_FLAG_HOLD, true);
if ($this->_order->canHold()) { if ($this->_order->canHold()) {
$this->_order->hold(); $this->_order->hold();
} else { } else {
...@@ -580,6 +584,9 @@ class Cron ...@@ -580,6 +584,9 @@ class Cron
return; return;
} }
} else { } else {
// Allow magento to cancel order
$this->_order->setActionFlag(\Magento\Sales\Model\Order::ACTION_FLAG_CANCEL, true);
if ($this->_order->canCancel()) { if ($this->_order->canCancel()) {
$this->_order->cancel(); $this->_order->cancel();
} else { } else {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "adyen/module-payment", "name": "adyen/module-payment",
"description": "Official Magento2 Plugin to connect to Payment Service Provider Adyen.", "description": "Official Magento2 Plugin to connect to Payment Service Provider Adyen.",
"type": "magento2-module", "type": "magento2-module",
"version": "1.4.1", "version": "1.4.2",
"license": [ "license": [
"OSL-3.0", "OSL-3.0",
"AFL-3.0" "AFL-3.0"
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
--> -->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Adyen_Payment" setup_version="1.4.1"> <module name="Adyen_Payment" setup_version="1.4.2">
<sequence> <sequence>
<module name="Magento_Sales"/> <module name="Magento_Sales"/>
<module name="Magento_Quote"/> <module name="Magento_Quote"/>
......
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