Skip to content

Commit

Permalink
Merge pull request #18631 from eileenmcnaughton/ppp
Browse files Browse the repository at this point in the history
dev/financial#152 [REF] Parse ids before sending to single function (minor simplification)
  • Loading branch information
colemanw authored Oct 10, 2020
2 parents 24485aa + 2f98824 commit 6ed4a27
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions CRM/Core/Payment/PayPalProIPN.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,11 @@ public function recur($input, $ids, $objects, $first) {
// CRM-13737 - am not aware of any reason why payment_date would not be set - this if is a belt & braces
$objects['contribution']->receive_date = !empty($input['payment_date']) ? date('YmdHis', strtotime($input['payment_date'])) : $now;

$this->single($input, $ids, $objects, TRUE, $first);
$this->single($input, [
'related_contact' => $ids['related_contact'] ?? NULL,
'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL,
'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL,
], $objects, TRUE, $first);
}

/**
Expand Down Expand Up @@ -364,11 +368,7 @@ public function single($input, $ids, $objects, $recur = FALSE, $first = FALSE) {
return;
}

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,
], $objects);
CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $objects);
}

/**
Expand Down Expand Up @@ -480,7 +480,11 @@ public function main() {
return;
}
}
$this->single($input, $ids, $objects, FALSE, FALSE);
$this->single($input, [
'related_contact' => $ids['related_contact'] ?? NULL,
'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL,
'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL,
], $objects, FALSE, FALSE);
}
catch (CRM_Core_Exception $e) {
Civi::log()->debug($e->getMessage());
Expand Down

0 comments on commit 6ed4a27

Please sign in to comment.