CRM-18369 fix repeattransaction function signature
authoreileenmcnaugton <eileen@fuzion.co.nz>
Wed, 6 Apr 2016 10:20:54 +0000 (22:20 +1200)
committereileenmcnaugton <eileen@fuzion.co.nz>
Sun, 10 Apr 2016 20:56:12 +0000 (08:56 +1200)
CRM/Contribute/BAO/Contribution.php
api/v3/Contribution.php

index 2e967673f99b04cf685b7f5e73eeaf3a82019ed0..14dd595f458397d5a2460ce584057269046dbdd2 100644 (file)
@@ -4495,7 +4495,7 @@ LIMIT 1;";
 
     $contributionParams['id'] = $contribution->id;
 
-    civicrm_api3('Contribution', 'create', $contributionParams);
+    $contributionResult = civicrm_api3('Contribution', 'create', $contributionParams);
 
     // Add new soft credit against current $contribution.
     if (CRM_Utils_Array::value('contributionRecur', $objects) && $objects['contributionRecur']->id) {
@@ -4584,6 +4584,7 @@ LIMIT 1;";
       CRM_Contribute_BAO_ContributionRecur::sendRecurringStartOrEndNotification($ids, $recur,
         $isFirstOrLastRecurringPayment);
     }
+    return $contributionResult;
   }
 
   /**
index a95bf6a0e4cd65352fcba1ea4ab988c4cb1c9646..08c132edd279ada1de65e2c3ad9f3fb61431de48 100644 (file)
@@ -445,8 +445,11 @@ function _civicrm_api3_contribution_sendconfirmation_spec(&$params) {
  * @param array $params
  *   Input parameters.
  *
- * @throws API_Exception
- *   Api result array.
+ * @return array
+ *   API result array
+ * @throws \API_Exception
+ * @throws \CRM_Core_Exception
+ * @throws \Exception
  */
 function civicrm_api3_contribution_completetransaction(&$params) {
 
@@ -471,7 +474,7 @@ function civicrm_api3_contribution_completetransaction(&$params) {
   if (!empty($params['fee_amount'])) {
     $input['fee_amount'] = $params['fee_amount'];
   }
-  $params = _ipn_process_transaction($params, $contribution, $input, $ids);
+  return _ipn_process_transaction($params, $contribution, $input, $ids);
 
 }
 
@@ -571,7 +574,7 @@ function civicrm_api3_contribution_repeattransaction(&$params) {
     );
     $input = array_intersect_key($params, array_fill_keys($passThroughParams, NULL));
 
-    $params = _ipn_process_transaction($params, $contribution, $input, $ids, $original_contribution);
+    return _ipn_process_transaction($params, $contribution, $input, $ids, $original_contribution);
   }
   catch(Exception $e) {
     throw new API_Exception('failed to load related objects' . $e->getMessage() . "\n" . $e->getTraceAsString());
@@ -621,9 +624,9 @@ function _ipn_process_transaction(&$params, $contribution, $input, $ids, $firstC
     $input['receipt_from_email'] = CRM_Utils_Array::value('receipt_from_email', $params, $domainFromEmail);
   }
   $transaction = new CRM_Core_Transaction();
-  CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $objects, $transaction, !empty($contribution->contribution_recur_id), $contribution,
+  return CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $objects, $transaction, !empty
+  ($contribution->contribution_recur_id), $contribution,
     FALSE, FALSE);
-  return $params;
 }
 
 /**