From: Eileen McNaughton Date: Wed, 24 Jun 2015 23:36:33 +0000 (+1200) Subject: CRM-16417 improve error presentation X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=73baf02a686c828e9972239ce4091bf142bf1dfe;p=civicrm-core.git CRM-16417 improve error presentation --- diff --git a/CRM/Contribute/BAO/Contribution/Utils.php b/CRM/Contribute/BAO/Contribution/Utils.php index f0c89a2fec..ebb2d91010 100644 --- a/CRM/Contribute/BAO/Contribution/Utils.php +++ b/CRM/Contribute/BAO/Contribution/Utils.php @@ -265,6 +265,7 @@ class CRM_Contribute_BAO_Contribution_Utils { } $result['is_payment_failure'] = TRUE; + $result['error'] = $e; } } diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 8ec906cc3b..9b8a8c76ca 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -728,7 +728,9 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr $contactID = $this->getContactID(); $result = $this->processFormSubmission($contactID); if (is_array($result) && !empty($result['is_payment_failure'])) { - CRM_Core_Error::displaySessionError($result); + // We will probably have the function that gets this error throw an exception on the next round of refactoring. + CRM_Core_Session::singleton()->setStatus(ts("Payment Processor Error message :") . + $result['error']->getMessage()); CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/transact', "_qf_Main_display=true&qfKey={$this->_params['qfKey']}" ));