From: eileen Date: Sat, 10 Oct 2020 21:54:36 +0000 (+1300) Subject: dev/financial#152 Remove unused parameters from BaseIPN->failed signature X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=09cafd476c326eaa1910aa266db2e53320e8fb58;p=civicrm-core.git dev/financial#152 Remove unused parameters from BaseIPN->failed signature Same as https://github.com/civicrm/civicrm-core/pull/18730 but for failed --- diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index e1fa68af31..531a3690ac 100644 --- a/CRM/Core/Payment/BaseIPN.php +++ b/CRM/Core/Payment/BaseIPN.php @@ -162,13 +162,11 @@ class CRM_Core_Payment_BaseIPN { * Set contribution to failed. * * @param array $objects - * @param object $transaction - * @param array $input * * @return bool - * @throws \CiviCRM_API3_Exception + * @throws \CiviCRM_API3_Exception|\CRM_Core_Exception */ - public function failed(&$objects, $transaction = NULL, $input = []) { + public function failed($objects) { $contribution = &$objects['contribution']; $memberships = []; if (!empty($objects['membership'])) { @@ -206,9 +204,6 @@ class CRM_Core_Payment_BaseIPN { $this->cancelParticipant($participant->id); } - if ($transaction) { - $transaction->commit(); - } Civi::log()->debug("Setting contribution status to Failed"); return TRUE; } diff --git a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php index 4b4da2c8de..cb2f3f82c0 100644 --- a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php @@ -441,8 +441,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { 'status_id' => 'Pending from incomplete transaction', ]); - $transaction = new CRM_Core_Transaction(); - $this->IPN->failed($this->objects, $transaction); + $this->IPN->failed($this->objects); $cancelledParticipantsCount = civicrm_api3('Participant', 'get', [ 'sequential' => 1,