From 10e6712c83c71613e12208d1f6c49e7c7efef4a9 Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 24 Dec 2020 14:39:53 +1300 Subject: [PATCH] Simplify handling of ids in Authorize.net now that related_contact is no longer used --- CRM/Contribute/BAO/Contribution.php | 1 - CRM/Core/Payment/AuthorizeNetIPN.php | 14 ++++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index f535d6487d89..2d5788b89679 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -4186,7 +4186,6 @@ public static function completeOrder($input, $ids, $contribution, $isPostPayment // @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. - $contributionContactID = $ids['related_contact']; $participantID = $ids['participant']; $recurringContributionID = $ids['contributionRecur']; diff --git a/CRM/Core/Payment/AuthorizeNetIPN.php b/CRM/Core/Payment/AuthorizeNetIPN.php index aeac1d9e5173..564a9572836f 100644 --- a/CRM/Core/Payment/AuthorizeNetIPN.php +++ b/CRM/Core/Payment/AuthorizeNetIPN.php @@ -89,11 +89,7 @@ public function main() { $contribution->receive_date = $input['receive_date']; } $input['payment_processor_id'] = $paymentProcessorID; - $isFirstOrLastRecurringPayment = $this->recur($input, [ - 'related_contact' => $ids['related_contact'] ?? NULL, - 'participant' => NULL, - 'contributionRecur' => $contributionRecur->id, - ], $contributionRecur, $contribution, $first); + $isFirstOrLastRecurringPayment = $this->recur($input, $contributionRecur, $contribution, $first); if ($isFirstOrLastRecurringPayment) { //send recurring Notification email for user @@ -115,7 +111,6 @@ public function main() { /** * @param array $input - * @param array $ids * @param \CRM_Contribute_BAO_ContributionRecur $recur * @param \CRM_Contribute_BAO_Contribution $contribution * @param bool $first @@ -124,7 +119,7 @@ public function main() { * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - public function recur($input, $ids, $recur, $contribution, $first) { + public function recur($input, $recur, $contribution, $first) { // do a subscription check if ($recur->processor_id != $input['subscription_id']) { @@ -183,7 +178,10 @@ public function recur($input, $ids, $recur, $contribution, $first) { return FALSE; } - CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $contribution); + CRM_Contribute_BAO_Contribution::completeOrder($input, [ + 'participant' => NULL, + 'contributionRecur' => $recur->id, + ], $contribution); return $isFirstOrLastRecurringPayment; }