From 01ebb9d33e22edd72600a1b03845703bc4da1627 Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 11 Oct 2020 10:20:33 +1300 Subject: [PATCH] Remove unused parameters from BaseIPN->cancelled signature --- CRM/Core/Payment/BaseIPN.php | 10 ++-------- tests/phpunit/CRM/Core/Payment/BaseIPNTest.php | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index e1fa68af31..e8b9fdc96f 100644 --- a/CRM/Core/Payment/BaseIPN.php +++ b/CRM/Core/Payment/BaseIPN.php @@ -235,13 +235,11 @@ class CRM_Core_Payment_BaseIPN { * 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'])) { @@ -264,7 +262,6 @@ class CRM_Core_Payment_BaseIPN { ]); $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. @@ -291,9 +288,6 @@ class CRM_Core_Payment_BaseIPN { $this->cancelParticipant($participant->id); } - if ($transaction) { - $transaction->commit(); - } Civi::log()->debug("Setting contribution status to Cancelled"); return TRUE; } diff --git a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php index 4b4da2c8de..9a80a19ffc 100644 --- a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php @@ -413,7 +413,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { ]); $transaction = new CRM_Core_Transaction(); - $this->IPN->cancelled($this->objects, $transaction); + $this->IPN->cancelled($this->objects); $cancelledParticipantsCount = civicrm_api3('Participant', 'get', [ 'sequential' => 1, -- 2.25.1