Skip to content

Commit

Permalink
Merge pull request #18732 from eileenmcnaughton/fail
Browse files Browse the repository at this point in the history
dev/financial#152 Remove unused parameters from BaseIPN->failed signature
  • Loading branch information
seamuslee001 authored Oct 11, 2020
2 parents cf948a8 + 09cafd4 commit ce8e5cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
9 changes: 2 additions & 7 deletions CRM/Core/Payment/BaseIPN.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,11 @@ public function loadObjects($input, &$ids, &$objects, $required, $paymentProcess
* 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'])) {
Expand Down Expand Up @@ -206,9 +204,6 @@ public function failed(&$objects, $transaction = NULL, $input = []) {
$this->cancelParticipant($participant->id);
}

if ($transaction) {
$transaction->commit();
}
Civi::log()->debug("Setting contribution status to Failed");
return TRUE;
}
Expand Down
3 changes: 1 addition & 2 deletions tests/phpunit/CRM/Core/Payment/BaseIPNTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,7 @@ public function testThatFailedEventPaymentWillCancelAllAdditionalPendingParticip
'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,
Expand Down

0 comments on commit ce8e5cf

Please sign in to comment.