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
......@@ -41,6 +41,11 @@ class Validate3d extends \Magento\Payment\Block\Form
*/
protected $_order;
/**
* @var \Magento\Framework\App\RequestInterface
*/
protected $_request;
/**
* Validate3d constructor.
*
......@@ -53,10 +58,12 @@ class Validate3d extends \Magento\Payment\Block\Form
\Magento\Framework\View\Element\Template\Context $context,
array $data = [],
\Magento\Sales\Model\OrderFactory $orderFactory,
\Magento\Checkout\Model\Session $checkoutSession
\Magento\Checkout\Model\Session $checkoutSession,
\Magento\Framework\App\RequestInterface $request
) {
$this->_orderFactory = $orderFactory;
$this->_checkoutSession = $checkoutSession;
$this->_request = $request;
parent::__construct($context, $data);
$this->_getOrder();
}
......@@ -114,8 +121,18 @@ class Validate3d extends \Magento\Payment\Block\Form
*/
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
*/
protected $_logger;
/**
* @var Resource\Notification\CollectionFactory
*/
......@@ -570,9 +571,12 @@ class Cron
// check if order has in invoice only cancel/hold if this is not the case
if ($ignoreHasInvoice || !$this->_order->hasInvoices()) {
$this->_order->setActionFlag($orderStatus, true);
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()) {
$this->_order->hold();
} else {
......@@ -580,6 +584,9 @@ class Cron
return;
}
} else {
// Allow magento to cancel order
$this->_order->setActionFlag(\Magento\Sales\Model\Order::ACTION_FLAG_CANCEL, true);
if ($this->_order->canCancel()) {
$this->_order->cancel();
} else {
......
......@@ -2,7 +2,7 @@
"name": "adyen/module-payment",
"description": "Official Magento2 Plugin to connect to Payment Service Provider Adyen.",
"type": "magento2-module",
"version": "1.4.1",
"version": "1.4.2",
"license": [
"OSL-3.0",
"AFL-3.0"
......
......@@ -24,7 +24,7 @@
-->
<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>
<module name="Magento_Sales"/>
<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