Skip to content

Commit

Permalink
Merge pull request #18629 from eileenmcnaughton/aipn
Browse files Browse the repository at this point in the history
dev/financial#152 [REF] Parse ids before sending to recur function (minor simplification)
  • Loading branch information
colemanw authored Oct 10, 2020
2 parents fcc2788 + e6f02af commit 24485aa
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions CRM/Core/Payment/AuthorizeNetIPN.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,14 @@ public function main($component = 'contribute') {
$objects['contribution'] = &$contribution;
}
$input['payment_processor_id'] = $paymentProcessorID;
return $this->recur($input, $ids, $objects, $first);
return $this->recur($input, [
'related_contact' => $ids['related_contact'] ?? NULL,
'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL,
'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL,
'membership' => $ids['membership'] ?? NULL,
'contact' => $ids['contact'] ?? NULL,
'contributionPage' => $ids['contributionPage'] ?? NULL,
], $objects, $first);
}
}
return TRUE;
Expand Down Expand Up @@ -222,11 +229,7 @@ public function recur($input, $ids, $objects, $first) {
return TRUE;
}

CRM_Contribute_BAO_Contribution::completeOrder($input, [
'related_contact' => $ids['related_contact'] ?? NULL,
'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL,
'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL,
], ['contribution' => $objects['contribution']]);
CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, ['contribution' => $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
Expand Down

0 comments on commit 24485aa

Please sign in to comment.