From e8c64ee02d922f04ad78e2b0e848adb4007b538b Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 26 Nov 2020 08:20:24 +1300 Subject: [PATCH] [REF] Simplify sendNotification determination --- CRM/Core/Payment/PayPalIPN.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CRM/Core/Payment/PayPalIPN.php b/CRM/Core/Payment/PayPalIPN.php index 14279e30a7..5a26991b6b 100644 --- a/CRM/Core/Payment/PayPalIPN.php +++ b/CRM/Core/Payment/PayPalIPN.php @@ -95,7 +95,6 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { $now = date('YmdHis'); - $sendNotification = FALSE; $subscriptionPaymentStatus = NULL; // set transaction type $txnType = $this->retrieve('txn_type', 'String'); @@ -113,7 +112,6 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { } $recur->processor_id = $this->retrieve('subscr_id', 'String'); $recur->trxn_id = $recur->processor_id; - $sendNotification = TRUE; $subscriptionPaymentStatus = CRM_Core_Payment::RECURRING_PAYMENT_START; break; @@ -122,7 +120,6 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { $recur->contribution_status_id = $contributionStatuses['Completed']; } $recur->end_date = $now; - $sendNotification = TRUE; $subscriptionPaymentStatus = CRM_Core_Payment::RECURRING_PAYMENT_END; break; @@ -159,7 +156,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { $recur->save(); - if ($sendNotification) { + if (in_array($this->retrieve('txn_type', 'String'), ['subscr_signup', 'subscr_eot'])) { $autoRenewMembership = FALSE; if ($recur->id && isset($ids['membership']) && $ids['membership'] -- 2.25.1