}
}
- CRM_Member_BAO_Membership::postProcessMembership($membershipParams, $contactID,
- $this, $premiumParams, $customFieldsFormatted,
- $fieldTypes
- );
+ try {
+ CRM_Member_BAO_Membership::postProcessMembership($membershipParams, $contactID,
+ $this, $premiumParams, $customFieldsFormatted,
+ $fieldTypes
+ );
+ } catch (CRM_Core_Exception $e) {
+ CRM_Core_Session::singleton()->setStatus($e->getMessage());
+ CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/transact', "_qf_Main_display=true&qfKey={$this->_params['qfKey']}"));
+ }
}
}
else {
$this->setDefaultCallback(array($this, 'handlePES'));
}
- function getMessages(&$error, $separator = '<br />') {
+ static public function getMessages(&$error, $separator = '<br />') {
if (is_a($error, 'CRM_Core_Error')) {
$errors = $error->getErrors();
$message = array();
}
}
$message = ts('Payment Processor Error message') . ': ' . implode('<br/>', $message);
- // Redirect the form in case of error
- // @todo this redirect in the BAO layer is really bad & should be moved to the form layer
- // however since we have no idea how (if) this is triggered we can't safely move / remove it
- $errorParams = array(
- 'legacy_redirect_path' => 'civicrm/contribute/transact',
- 'legacy_redirect_query' => "_qf_Main_display=true&qfKey={$form->_params['qfKey']}",
- );
- throw new CRM_Core_Exception($message, 0, $errorParams);
+ throw new CRM_Core_Exception($message);
}
// CRM-7851