test fix
authoreileenmcnaughton <eileen@fuzion.co.nz>
Mon, 13 Jul 2015 06:33:27 +0000 (06:33 +0000)
committereileenmcnaughton <eileen@fuzion.co.nz>
Mon, 13 Jul 2015 06:33:27 +0000 (06:33 +0000)
CRM/Contribute/Form/Contribution/Confirm.php

index 1e0d0e9adc40d6c60f27826a3feefbf9e53c560b..b6e9271399a5872c7f287f7a53c5758f36d61e11 100644 (file)
@@ -1842,7 +1842,14 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
 
     $result = NULL;
     if ($form->_values['is_monetary'] && !$form->_params['is_pay_later'] && $minimumFee > 0.0) {
-      $payment = $form->_paymentProcessor['object'];
+      // At the moment our tests are calling this form in a way that leaves 'object' empty. For
+      // now we compensate here.
+      if (empty($form->_paymentProcessor['object'])) {
+        $payment = Civi\Payment\System::singleton()->getByProcessor($this->_paymentProcessor);
+      }
+      else {
+        $payment = $form->_paymentProcessor['object'];
+      }
 
       if ($form->_contributeMode == 'express') {
         $result = $payment->doExpressCheckout($tempParams);