*
* @param array $input
* @param array $ids
- * @param array $objects
+ * @param \CRM_Contribute_BAO_ContributionRecur $recur
+ * @param \CRM_Contribute_BAO_Contribution $contribution
* @param bool $first
*
+ * @throws \API_Exception
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
+ * @throws \Civi\API\Exception\UnauthorizedException
*/
- public function recur($input, $ids, $objects, $first) {
+ public function recur($input, $ids, $recur, $contribution, $first) {
if (!isset($input['txnType'])) {
Civi::log()->debug('PayPalProIPN: Could not find txn_type in input request.');
echo 'Failure: Invalid parameters<p>';
return;
}
- $recur = &$objects['contributionRecur'];
-
// make sure the invoice ids match
// make sure the invoice is valid and matches what we have in
// the contribution record
}
// CRM-13737 - am not aware of any reason why payment_date would not be set - this if is a belt & braces
- $objects['contribution']->receive_date = !empty($input['payment_date']) ? date('YmdHis', strtotime($input['payment_date'])) : $now;
+ $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,
- ], $objects['contribution'], TRUE, $first);
+ ], $contribution, TRUE, $first);
}
/**
if ($objects['contribution']->contribution_status_id == $completedStatusId) {
$first = FALSE;
}
- $this->recur($input, $ids, $objects, $first);
+ $this->recur($input, $ids, $objects['contributionRecur'], $objects['contribution'], $first);
return;
}
if (!$this->loadObjects($input, $ids, $objects, TRUE, $paymentProcessorID)) {
throw new CRM_Core_Exception('Data did not validate');
}
- $this->recur($input, $ids, $objects, $isFirst);
+ $this->recur($input, $ids, $objects['contributionRecur'], $objects['contribution'], $isFirst);
}
/**