Skip to content
Snippets Groups Projects
Commit f6973d25 authored by eileen's avatar eileen
Browse files

financial#152 Pass specific BAO into the recur function rather than the vague 'objects'

parent f72d958c
No related branches found
No related tags found
No related merge requests found
......@@ -61,7 +61,8 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN {
/**
* @param array $input
* @param array $ids
* @param array $objects
* @param CRM_Contribute_BAO_ContributionRecur $recur
* @param CRM_Contribute_BAO_Contribution $contribution
* @param bool $first
*
* @return void
......@@ -69,7 +70,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN {
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
*/
public function recur($input, $ids, $objects, $first) {
public function recur($input, $ids, $recur, $contribution, $first) {
if (!isset($input['txnType'])) {
Civi::log()->debug('PayPalIPN: Could not find txn_type in input request');
echo "Failure: Invalid parameters<p>";
......@@ -84,8 +85,6 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN {
return;
}
$recur = &$objects['contributionRecur'];
// make sure the invoice ids match
// make sure the invoice is valid and matches what we have in the contribution record
if ($recur->invoice_id != $input['invoice']) {
......@@ -210,7 +209,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN {
'related_contact' => $ids['related_contact'] ?? NULL,
'participant' => $ids['participant'] ?? NULL,
'contributionRecur' => $recur->id,
], $objects['contribution'], TRUE);
], $contribution, TRUE);
}
/**
......@@ -373,7 +372,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN {
if ($objects['contribution']->contribution_status_id == $completedStatusId) {
$first = FALSE;
}
$this->recur($input, $ids, $objects, $first);
$this->recur($input, $ids, $objects['contributionRecur'], $objects['contribution'], $first);
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment