Skip to content

Commit

Permalink
Simplify handling of ids in Authorize.net now that related_contact is…
Browse files Browse the repository at this point in the history
… no longer used
  • Loading branch information
eileenmcnaughton committed Dec 24, 2020
1 parent b2b9e8c commit 10e6712
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
1 change: 0 additions & 1 deletion CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

Expand Down
14 changes: 6 additions & 8 deletions CRM/Core/Payment/AuthorizeNetIPN.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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']) {
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 10e6712

Please sign in to comment.