Update related contribution trxn_id before sending email
authorEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 5 Jul 2023 01:39:42 +0000 (13:39 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 5 Jul 2023 01:40:14 +0000 (13:40 +1200)
This will allow https://github.com/civicrm/civicrm-core/pull/26659 to pass & merge

CRM/Financial/BAO/Payment.php

index 97795f7cac191bea154a63f8d6670002f46fb089..d7e7a5f7c076f0ea097c4042d9a05534c55621f1 100644 (file)
@@ -169,7 +169,7 @@ class CRM_Financial_BAO_Payment {
         }
       }
     }
-
+    self::updateRelatedContribution($params, $params['contribution_id']);
     if ($isPaymentCompletesContribution) {
       if ($contributionStatus === 'Pending refund') {
         // Ideally we could still call completetransaction as non-payment related actions should
@@ -213,7 +213,6 @@ class CRM_Financial_BAO_Payment {
       //  change status to refunded.
       self::updateContributionStatus($contribution['id'], 'Refunded');
     }
-    self::updateRelatedContribution($params, $params['contribution_id']);
     CRM_Contribute_BAO_Contribution::recordPaymentActivity($params['contribution_id'], CRM_Utils_Array::value('participant_id', $params), $params['total_amount'], $trxn->currency, $trxn->trxn_date);
     return $trxn;
   }