Skip to content

Commit

Permalink
Merge pull request #18044 from eileenmcnaughton/pprefs
Browse files Browse the repository at this point in the history
Fix PaypalIPN single function to not receive-by-reference
  • Loading branch information
mattwire authored Aug 3, 2020
2 parents 322acf8 + 8480170 commit a7a22b8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions CRM/Core/Payment/PayPalIPN.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,10 @@ public function recur($input, $ids, $objects, $first) {
* @param bool $first
*
* @return void
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
*/
public function single(&$input, &$ids, &$objects, $recur = FALSE, $first = FALSE) {
public function single($input, $ids, $objects, $recur = FALSE, $first = FALSE) {
$contribution = &$objects['contribution'];

// make sure the invoice is valid and matches what we have in the contribution record
Expand All @@ -257,15 +259,15 @@ public function single(&$input, &$ids, &$objects, $recur = FALSE, $first = FALSE
}

$status = $input['paymentStatus'];
if ($status == 'Denied' || $status == 'Failed' || $status == 'Voided') {
if ($status === 'Denied' || $status === 'Failed' || $status === 'Voided') {
$this->failed($objects);
return;
}
if ($status === 'Pending') {
Civi::log()->debug('Returning since contribution status is Pending');
return;
}
elseif ($status == 'Refunded' || $status == 'Reversed') {
elseif ($status === 'Refunded' || $status === 'Reversed') {
$this->cancelled($objects);
return;
}
Expand Down Expand Up @@ -369,7 +371,7 @@ public function main() {
return;
}
}
$this->single($input, $ids, $objects, FALSE, FALSE);
$this->single($input, $ids, $objects);
}

/**
Expand Down

0 comments on commit a7a22b8

Please sign in to comment.