Remove some unused params & a call by reference
authorEileen McNaughton <eileen@fuzion.co.nz>
Tue, 2 Jun 2015 09:52:30 +0000 (21:52 +1200)
committerEileen McNaughton <eileen@fuzion.co.nz>
Tue, 2 Jun 2015 09:52:30 +0000 (21:52 +1200)
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/BAO/Contribution/Utils.php
CRM/Contribute/Form/Contribution/Confirm.php

index 0eb61aab7f6c62908d2261c71cb75a4dba1299ec..b12a35e6c1d24252b6eeae6b49f4d69d5950cb7b 100644 (file)
@@ -2196,10 +2196,7 @@ WHERE  contribution_id = %1 ";
     //what does recur 'mean here - to do with payment processor return functionality but
     // what is the importance
     if ($recur && !empty($this->_relatedObjects['paymentProcessor'])) {
-      $paymentObject = &CRM_Core_Payment::singleton(
-        $this->is_test ? 'test' : 'live',
-        $this->_relatedObjects['paymentProcessor']
-      );
+      $paymentObject = Civi\Payment\System::singleton()->getByProcessor($this->_relatedObjects['paymentProcessor']);
 
       $entityID = $entity = NULL;
       if (isset($ids['contribution'])) {
index 202d22066daae97acc5ecf6c175f7f036f7011d4..a94aea192399c0581fd1411bec2f73a872faa2f7 100644 (file)
@@ -100,7 +100,7 @@ class CRM_Contribute_BAO_Contribution_Utils {
     //fix for CRM-2062
     //fix for CRM-16317
 
-    $now = $form->_params['receive_date'] = date('YmdHis');
+    $form->_params['receive_date'] = date('YmdHis');
     $form->assign('receive_date',
       CRM_Utils_Date::mysqlToIso($form->_params['receive_date'])
     );
index a74688cc2ca23a7b12e5d0599151fac5dd497985..b41405eec543b7eb5eed28091f6dc5d36181e3d2 100644 (file)
@@ -736,17 +736,14 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
     // add a description field at the very beginning
     $this->_params['description'] = ts('Online Contribution') . ': ' . (($this->_pcpInfo['title']) ? $this->_pcpInfo['title'] : $this->_values['title']);
 
-    // also add accounting code
-    $this->_params['accountingCode'] = CRM_Utils_Array::value('accountingCode',
-      $this->_values
-    );
+    $this->_params['accountingCode'] = CRM_Utils_Array::value('accountingCode', $this->_values);
 
     // fix currency ID
     $this->_params['currencyID'] = CRM_Core_Config::singleton()->defaultCurrency;
 
     //carry payment processor id.
-    if ($paymentProcessorId = CRM_Utils_Array::value('id', $this->_paymentProcessor)) {
-      $this->_params['payment_processor_id'] = $paymentProcessorId;
+    if (CRM_Utils_Array::value('id', $this->_paymentProcessor)) {
+      $this->_params['payment_processor_id'] = $this->_paymentProcessor['id'];
     }
     if (!empty($params['image_URL'])) {
       CRM_Contact_BAO_Contact::processImageParams($params);