We no longer use ids['related_contact'] & are attempting to simplify (& eventually remove
the ids variable)
// make sure the invoice is valid and matches what we have in the contribution record
if ($recur->invoice_id != $input['invoice']) {
Civi::log()->debug('PayPalIPN: Invoice values dont match between database and IPN request (RecurID: ' . $recur->id . ').');
// make sure the invoice is valid and matches what we have in the contribution record
if ($recur->invoice_id != $input['invoice']) {
Civi::log()->debug('PayPalIPN: Invoice values dont match between database and IPN request (RecurID: ' . $recur->id . ').');
- echo "Failure: Invoice values dont match between database and IPN request<p>";
- return;
+ throw new CRM_Core_Exception("Failure: Invoice values dont match between database and IPN request");
- if ($this->getFirstOrLastInSeriesStatus()) {
- //send recurring Notification email for user
- CRM_Contribute_BAO_ContributionPage::recurringNotify($this->getFirstOrLastInSeriesStatus(),
- $ids['contact'],
- $ids['contributionPage'],
- $recur,
- !empty($ids['membership'])
- );
- }
-
if ($txnType !== 'subscr_payment') {
return;
}
if ($txnType !== 'subscr_payment') {
return;
}
}
$this->single($input, [
}
$this->single($input, [
- 'related_contact' => $ids['related_contact'] ?? NULL,
'participant' => $ids['participant'] ?? NULL,
'contributionRecur' => $recur->id,
], $contribution, TRUE);
'participant' => $ids['participant'] ?? NULL,
'contributionRecur' => $recur->id,
], $contribution, TRUE);
$first = FALSE;
}
$this->recur($input, $ids, $contributionRecur, $contribution, $first);
$first = FALSE;
}
$this->recur($input, $ids, $contributionRecur, $contribution, $first);
+ if ($this->getFirstOrLastInSeriesStatus()) {
+ //send recurring Notification email for user
+ CRM_Contribute_BAO_ContributionPage::recurringNotify($this->getFirstOrLastInSeriesStatus(),
+ $ids['contact'],
+ $ids['contributionPage'],
+ $contributionRecur,
+ !empty($ids['membership'])
+ );
+ }
return;
}
$this->single($input, [
return;
}
$this->single($input, [
- 'related_contact' => $ids['related_contact'] ?? NULL,
'participant' => $ids['participant'] ?? NULL,
'contributionRecur' => $contributionRecurID,
], $contribution);
'participant' => $ids['participant'] ?? NULL,
'contributionRecur' => $contributionRecurID,
], $contribution);
$contribution->receive_date = !empty($input['payment_date']) ? date('YmdHis', strtotime($input['payment_date'])) : $now;
$this->single($input, [
$contribution->receive_date = !empty($input['payment_date']) ? date('YmdHis', strtotime($input['payment_date'])) : $now;
$this->single($input, [
- 'related_contact' => $ids['related_contact'] ?? NULL,
'participant' => $ids['participant'] ?? NULL,
'contributionRecur' => $recur->id ?? NULL,
], $contribution, TRUE, $first);
'participant' => $ids['participant'] ?? NULL,
'contributionRecur' => $recur->id ?? NULL,
], $contribution, TRUE, $first);
}
$this->single($input, [
}
$this->single($input, [
- 'related_contact' => $ids['related_contact'] ?? NULL,
'participant' => $ids['participant'] ?? NULL,
'contributionRecur' => $ids['contributionRecur'] ?? NULL,
], $contribution, FALSE, FALSE);
'participant' => $ids['participant'] ?? NULL,
'contributionRecur' => $ids['contributionRecur'] ?? NULL,
], $contribution, FALSE, FALSE);