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 22b67e98 authored by Maikel Koek's avatar Maikel Koek

[VM-336] +: Made return path (checkout/cart) configurable

parent 5982aa10
...@@ -91,6 +91,8 @@ class Result extends \Magento\Framework\App\Action\Action ...@@ -91,6 +91,8 @@ class Result extends \Magento\Framework\App\Action\Action
$response = $this->getRequest()->getParams(); $response = $this->getRequest()->getParams();
$this->_adyenLogger->addAdyenResult(print_r($response, true)); $this->_adyenLogger->addAdyenResult(print_r($response, true));
$failReturnPath = $this->_adyenHelper->getAdyenAbstractConfigData('return_path');
if ($response) { if ($response) {
$result = $this->validateResponse($response); $result = $this->validateResponse($response);
...@@ -100,11 +102,11 @@ class Result extends \Magento\Framework\App\Action\Action ...@@ -100,11 +102,11 @@ class Result extends \Magento\Framework\App\Action\Action
$this->_redirect('checkout/onepage/success', ['_query' => ['utm_nooverride' => '1']]); $this->_redirect('checkout/onepage/success', ['_query' => ['utm_nooverride' => '1']]);
} else { } else {
$this->_cancel($response); $this->_cancel($response);
$this->_redirect('checkout/cart'); $this->_redirect($failReturnPath);
} }
} else { } else {
// redirect to checkout page // redirect to checkout page
$this->_redirect('checkout/cart'); $this->_redirect($failReturnPath);
} }
} }
......
...@@ -98,7 +98,7 @@ class ResultPos extends \Magento\Framework\App\Action\Action ...@@ -98,7 +98,7 @@ class ResultPos extends \Magento\Framework\App\Action\Action
$this->_redirect('checkout/onepage/success', ['_query' => ['utm_nooverride' => '1']]); $this->_redirect('checkout/onepage/success', ['_query' => ['utm_nooverride' => '1']]);
} else { } else {
$this->_cancel($response); $this->_cancel($response);
$this->_redirect('checkout/cart'); $this->_redirect($this->_adyenHelper->getAdyenAbstractConfigData('return_path'));
} }
} }
......
...@@ -150,7 +150,7 @@ class Validate3d extends \Magento\Framework\App\Action\Action ...@@ -150,7 +150,7 @@ class Validate3d extends \Magento\Framework\App\Action\Action
// restore the quote // restore the quote
$session->restoreQuote(); $session->restoreQuote();
$this->_redirect('checkout/cart'); $this->_redirect($this->_adyenHelper->getAdyenAbstractConfigData('return_path'));
} }
} }
} else { } else {
......
...@@ -106,5 +106,10 @@ ...@@ -106,5 +106,10 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<config_path>payment/adyen_abstract/debug</config_path> <config_path>payment/adyen_abstract/debug</config_path>
</field> </field>
<field id="return_path" translate="label" type="text" sortOrder="150" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Checkout Return Path</label>
<config_path>payment/adyen_abstract/return_path</config_path>
<tooltip><![CDATA[The path the customer will be redirected to when payment was <b>not</b> successful. Default is <i>checkout/cart</i>.]]></tooltip>
</field>
</group> </group>
</include> </include>
\ No newline at end of file
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
<title_renderer>title_image</title_renderer> <title_renderer>title_image</title_renderer>
<sepa_flow>sale</sepa_flow> <sepa_flow>sale</sepa_flow>
<split_payments_refund_strategy>1</split_payments_refund_strategy> <split_payments_refund_strategy>1</split_payments_refund_strategy>
<return_path>checkout/cart</return_path>
<group>adyen</group> <group>adyen</group>
</adyen_abstract> </adyen_abstract>
<adyen_cc> <adyen_cc>
......
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