CRM-16417 improve error presentation
authorEileen McNaughton <eileen@fuzion.co.nz>
Wed, 24 Jun 2015 23:36:33 +0000 (11:36 +1200)
committerEileen McNaughton <eileen@fuzion.co.nz>
Wed, 24 Jun 2015 23:36:33 +0000 (11:36 +1200)
CRM/Contribute/BAO/Contribution/Utils.php
CRM/Contribute/Form/Contribution/Confirm.php

index f0c89a2fecfa670f51cc4437087c0d314d786bdf..ebb2d91010206679b16dd4ae3750721e9a742aa0 100644 (file)
@@ -265,6 +265,7 @@ class CRM_Contribute_BAO_Contribution_Utils {
         }
 
         $result['is_payment_failure'] = TRUE;
+        $result['error'] = $e;
       }
     }
 
index 8ec906cc3b8d132838bf747b9a7e1cb50d12fb31..9b8a8c76cae0bcbe10e23c2c9f82a9d01f2955de 100644 (file)
@@ -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']}"
       ));