From 73baf02a686c828e9972239ce4091bf142bf1dfe Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 25 Jun 2015 11:36:33 +1200 Subject: [PATCH] CRM-16417 improve error presentation --- CRM/Contribute/BAO/Contribution/Utils.php | 1 + CRM/Contribute/Form/Contribution/Confirm.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) 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']}" )); -- 2.25.1