* Process cancelled payment outcome.
*
* @param array $objects
- * @param CRM_Core_Transaction $transaction
- * @param array $input
*
* @return bool
- * @throws \CiviCRM_API3_Exception
+ * @throws \CiviCRM_API3_Exception|\CRM_Core_Exception
*/
- public function cancelled(&$objects, $transaction = NULL, $input = []) {
+ public function cancelled($objects) {
$contribution = &$objects['contribution'];
$memberships = [];
if (!empty($objects['membership'])) {
]);
$contribution->contribution_status_id = $contributionStatuses['Cancelled'];
$contribution->cancel_date = self::$_now;
- $contribution->cancel_reason = $input['reasonCode'] ?? NULL;
$contribution->save();
// Add line items for recurring payments.
$this->cancelParticipant($participant->id);
}
- if ($transaction) {
- $transaction->commit();
- }
Civi::log()->debug("Setting contribution status to Cancelled");
return TRUE;
}
]);
$transaction = new CRM_Core_Transaction();
- $this->IPN->cancelled($this->objects, $transaction);
+ $this->IPN->cancelled($this->objects);
$cancelledParticipantsCount = civicrm_api3('Participant', 'get', [
'sequential' => 1,