diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index e931c645dd0e92531d774dc8b78ffbb2739fae55..5423b6efd348d88817436d31df9d251c44647acc 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -4363,7 +4363,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac * * @param array $input * @param array $ids - * @param array $objects + * @param \CRM_Contribute_BAO_Contribution $contribution * @param bool $isPostPaymentCreate * Is this being called from the payment.create api. If so the api has taken care of financial entities. * Note that our goal is that this would only ever be called from payment.create and never handle financials (only @@ -4373,11 +4373,8 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - public static function completeOrder($input, $ids, $objects, $isPostPaymentCreate = FALSE) { + public static function completeOrder($input, $ids, $contribution, $isPostPaymentCreate = FALSE) { $transaction = new CRM_Core_Transaction(); - $contribution = $objects['contribution']; - // Unset objects just to make it clear it's not used again. - unset($objects); // @todo see if we even need this - it's used further down to create an activity // but the BAO layer should create that - we just need to add a test to cover it & can // maybe remove $ids altogether. diff --git a/CRM/Core/Payment/AuthorizeNetIPN.php b/CRM/Core/Payment/AuthorizeNetIPN.php index 1f36f4f3c4a5eb03b4374553b282da1d2a10f764..d72dc82fa22d430397b5f4430701bd729dc6d0d3 100644 --- a/CRM/Core/Payment/AuthorizeNetIPN.php +++ b/CRM/Core/Payment/AuthorizeNetIPN.php @@ -223,7 +223,7 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { return TRUE; } - CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, ['contribution' => $objects['contribution']]); + CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $objects['contribution']); // Only Authorize.net does this so it is on the a.net class. If there is a need for other processors // to do this we should make it available via the api, e.g as a parameter, changing the nuance diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index 9c2ec3ba201d6ce491e920c5370c16215a370732..614568b51889bbecade7c5dd2a84e7677f68ac86 100644 --- a/CRM/Core/Payment/BaseIPN.php +++ b/CRM/Core/Payment/BaseIPN.php @@ -416,7 +416,7 @@ class CRM_Core_Payment_BaseIPN { 'related_contact' => $ids['related_contact'] ?? NULL, 'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL, 'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL, - ], $objects); + ], $objects['contribution']); } /** diff --git a/CRM/Core/Payment/PayPalIPN.php b/CRM/Core/Payment/PayPalIPN.php index c9e35fae42977bd14e6d3da7df46f2d3ff723926..6f600ccd1dbb84bb83815db053dcc0d6d4dc4757 100644 --- a/CRM/Core/Payment/PayPalIPN.php +++ b/CRM/Core/Payment/PayPalIPN.php @@ -252,7 +252,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { return; } - CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $objects); + CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $objects['contribution']); } /** diff --git a/CRM/Core/Payment/PayPalProIPN.php b/CRM/Core/Payment/PayPalProIPN.php index 0a92f88cdcdd1296c82946974cc20c11c5fa993a..5f4ae129c802d9ba8817df16269e82079f3f0c58 100644 --- a/CRM/Core/Payment/PayPalProIPN.php +++ b/CRM/Core/Payment/PayPalProIPN.php @@ -346,7 +346,7 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN { return; } - CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $objects); + CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $objects['contribution']); } /** diff --git a/CRM/Event/Form/Task/Batch.php b/CRM/Event/Form/Task/Batch.php index 395feda8652fa7c75e9d4cf9f904de8d2369885c..c20505cc94e4d750936b3a1708acd4fb057a3a83 100644 --- a/CRM/Event/Form/Task/Batch.php +++ b/CRM/Event/Form/Task/Batch.php @@ -362,7 +362,7 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { 'related_contact' => NULL, 'participant' => $params['component_id'], 'contributionRecur' => NULL, - ], ['contribution' => $contribution]); + ], $contribution); // reset template values before processing next transactions $template->clearTemplateVars(); diff --git a/api/v3/Contribution.php b/api/v3/Contribution.php index 7a4da8e57ac9526615e6be2c77351f31e42192a8..de6bf1b0629acebab79c343281b1c8ec3681c82b 100644 --- a/api/v3/Contribution.php +++ b/api/v3/Contribution.php @@ -679,7 +679,7 @@ function _ipn_process_transaction($params, $contribution, $input, $ids) { 'related_contact' => $ids['related_contact'] ?? NULL, 'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL, 'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL, - ], $objects, + ], $objects['contribution'], $params['is_post_payment_create'] ?? NULL); }