Commit af1689b8 authored by rubofvil's avatar rubofvil
Browse files

Add set the 'successUrl' and 'cancelUrl' if is set in parymentProcessor instance

parent ccf94776
......@@ -114,8 +114,6 @@ class CRM_Core_Payment_Redsys extends CRM_Core_Payment {
*/
public function doTransferCheckout(&$params, $component = 'contribute') {
$config = CRM_Core_Config::singleton();
if ($component != 'contribute' && $component != 'event') {
CRM_Core_Error::fatal(E::ts('Component is invalid'));
}
......@@ -124,6 +122,12 @@ class CRM_Core_Payment_Redsys extends CRM_Core_Payment {
$returnURL = $params['webform_redirect_success'];
$cancelURL = $params['webform_redirect_cancel'];
}
elseif (!empty($this->successUrl)) {
$config = CRM_Core_Config::singleton();
$returnURL = (strpos($this->successUrl, '/') === 0) ? $config->userFrameworkBaseURL . $this->successUrl : $this->successUrl;
$cancelURL = (strpos($this->cancelUrl, '/') === 0) ? $config->userFrameworkBaseURL . $this->cancelUrl : $this->cancelUrl;
}
else {
$url = ($component == 'event') ? 'civicrm/event/register' : 'civicrm/contribute/transact';
$cancel = ($component == 'event') ? '_qf_Register_display' : '_qf_Main_display';
......
Supports Markdown
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