dev/financial#152 Remove unused parameters from BaseIPN->failed signature
authoreileen <emcnaughton@wikimedia.org>
Sat, 10 Oct 2020 21:54:36 +0000 (10:54 +1300)
committereileen <emcnaughton@wikimedia.org>
Sat, 10 Oct 2020 21:54:36 +0000 (10:54 +1300)
Same as https://github.com/civicrm/civicrm-core/pull/18730 but for failed

CRM/Core/Payment/BaseIPN.php
tests/phpunit/CRM/Core/Payment/BaseIPNTest.php

index e1fa68af31b61bc8293d58dbe01a0b7f1461d892..531a3690ac8b4dc777eae438c9f27a124a8127ab 100644 (file)
@@ -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;
   }
index 4b4da2c8de1a5cf4c9bc578385155c0181114c5b..cb2f3f82c0265f0a01eba0a01185f6a6ecc6816f 100644 (file)
@@ -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,