Remove first_contribution key from repeattransaction
authorMatthew Wire <mjw@mjwconsult.co.uk>
Wed, 19 Aug 2020 22:33:37 +0000 (23:33 +0100)
committerMatthew Wire <mjw@mjwconsult.co.uk>
Wed, 19 Aug 2020 22:35:05 +0000 (23:35 +0100)
CRM/Contribute/BAO/Contribution.php
CRM/Core/Payment/BaseIPN.php
api/v3/Contribution.php

index e5d83dd6cfeb24d22509b38c493b2a54a3339bc8..496d64dcda22e27a98927a4553f851efba859a22 100644 (file)
@@ -4455,7 +4455,6 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac
   public static function completeOrder($input, &$ids, $objects, $isPostPaymentCreate = FALSE) {
     $transaction = new CRM_Core_Transaction();
     $contribution = $objects['contribution'];
-    $primaryContributionID = $contribution->id ?? $objects['first_contribution']->id;
     // The previous details are used when calculating line items so keep it before any code that 'does something'
     if (!empty($contribution->id)) {
       $input['prevContribution'] = CRM_Contribute_BAO_Contribution::getValues(['id' => $contribution->id]);
index 27b0074814464f3a29b549dff6981386bdb2a272..930baec01633edbfe0f1ccacc8e56d16044a25a7 100644 (file)
@@ -135,12 +135,6 @@ class CRM_Core_Payment_BaseIPN {
     if (!$this->loadObjects($input, $ids, $objects, $required, $paymentProcessorID)) {
       return FALSE;
     }
-    //the process is that the loadObjects is kind of hacked by loading the objects for the original contribution and then somewhat inconsistently using them for the
-    //current contribution. Here we ensure that the original contribution is available to the complete transaction function
-    //we don't want to fix this in the payment processor classes because we would have to fix all of them - so better to fix somewhere central
-    if (isset($objects['contributionRecur'])) {
-      $objects['first_contribution'] = $objects['contribution'];
-    }
     return TRUE;
   }
 
index 298980b4a74acced636044863de2b1cc57d0d902..a1b06305e9593b5fa7ecb2bd622c20760ffae3f4 100644 (file)
@@ -654,10 +654,6 @@ function civicrm_api3_contribution_repeattransaction($params) {
 function _ipn_process_transaction(&$params, $contribution, $input, $ids, $firstContribution = NULL) {
   $objects = $contribution->_relatedObjects;
   $objects['contribution'] = &$contribution;
-
-  if ($firstContribution) {
-    $objects['first_contribution'] = $firstContribution;
-  }
   $input['component'] = $contribution->_component;
   $input['is_test'] = $contribution->is_test;
   $input['amount'] = empty($input['total_amount']) ? $contribution->total_amount : $input['total_amount'];