diff --git a/CRM/Core/Payment/PayPalIPN.php b/CRM/Core/Payment/PayPalIPN.php index 789dbbf6a6d7..2ec2c0f509ea 100644 --- a/CRM/Core/Payment/PayPalIPN.php +++ b/CRM/Core/Payment/PayPalIPN.php @@ -154,23 +154,16 @@ public function recur($input, $ids, $recur, $contribution, $first) { $recur->save(); if ($this->getFirstOrLastInSeriesStatus()) { - $autoRenewMembership = FALSE; - if ($recur->id && - isset($ids['membership']) && $ids['membership'] - ) { - $autoRenewMembership = TRUE; - } - //send recurring Notification email for user CRM_Contribute_BAO_ContributionPage::recurringNotify($this->getFirstOrLastInSeriesStatus(), $ids['contact'], $ids['contributionPage'], $recur, - $autoRenewMembership + !empty($ids['membership']) ); } - if ($txnType != 'subscr_payment') { + if ($txnType !== 'subscr_payment') { return; } @@ -185,7 +178,7 @@ public function recur($input, $ids, $recur, $contribution, $first) { return; } - if ($input['paymentStatus'] != 'Completed') { + if ($input['paymentStatus'] !== 'Completed') { throw new CRM_Core_Exception("Ignore all IPN payments that are not completed"); } diff --git a/CRM/Core/Payment/PayPalProIPN.php b/CRM/Core/Payment/PayPalProIPN.php index b38afa755ee9..0ea9694d4e33 100644 --- a/CRM/Core/Payment/PayPalProIPN.php +++ b/CRM/Core/Payment/PayPalProIPN.php @@ -257,22 +257,16 @@ public function recur($input, $ids, $recur, $contribution, $first) { $recur->save(); if ($sendNotification) { - $autoRenewMembership = FALSE; - if ($recur->id && - isset($ids['membership']) && $ids['membership'] - ) { - $autoRenewMembership = TRUE; - } //send recurring Notification email for user CRM_Contribute_BAO_ContributionPage::recurringNotify($subscriptionPaymentStatus, $ids['contact'], $ids['contributionPage'], $recur, - $autoRenewMembership + !empty($ids['membership']) ); } - if ($txnType != 'recurring_payment') { + if ($txnType !== 'recurring_payment') { return; }