Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] Param simplification #19406

Merged
merged 2 commits into from
Jan 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions CRM/Core/Payment/PayPalIPN.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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");
}

Expand Down
10 changes: 2 additions & 8 deletions CRM/Core/Payment/PayPalProIPN.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down