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

Merge pull request #271 from ho-nl-fork/return-path

[VM-336] +: Made return path (checkout/cart) configurable
parents 5982aa10 d32f6b26
......@@ -91,6 +91,8 @@ class Result extends \Magento\Framework\App\Action\Action
$response = $this->getRequest()->getParams();
$this->_adyenLogger->addAdyenResult(print_r($response, true));
$failReturnPath = $this->_adyenHelper->getAdyenAbstractConfigData('return_path');
if ($response) {
$result = $this->validateResponse($response);
......@@ -100,11 +102,11 @@ class Result extends \Magento\Framework\App\Action\Action
$this->_redirect('checkout/onepage/success', ['_query' => ['utm_nooverride' => '1']]);
} else {
$this->_cancel($response);
$this->_redirect('checkout/cart');
$this->_redirect($failReturnPath);
}
} else {
// redirect to checkout page
$this->_redirect('checkout/cart');
$this->_redirect($failReturnPath);
}
}
......
......@@ -98,7 +98,7 @@ class ResultPos extends \Magento\Framework\App\Action\Action
$this->_redirect('checkout/onepage/success', ['_query' => ['utm_nooverride' => '1']]);
} else {
$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
// restore the quote
$session->restoreQuote();
$this->_redirect('checkout/cart');
$this->_redirect($this->_adyenHelper->getAdyenAbstractConfigData('return_path'));
}
}
} else {
......
......@@ -37,6 +37,10 @@
<source_model>Adyen\Payment\Model\Config\Source\RenderMode</source_model>
<config_path>payment/adyen_abstract/title_renderer</config_path>
</field>
<field id="return_path" translate="label" type="text" sortOrder="20" 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>
</include>
\ No newline at end of file
......@@ -35,6 +35,7 @@
<title_renderer>title_image</title_renderer>
<sepa_flow>sale</sepa_flow>
<split_payments_refund_strategy>1</split_payments_refund_strategy>
<return_path>checkout/cart</return_path>
<group>adyen</group>
</adyen_abstract>
<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