X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FPayment%2FBaseIPN.php;h=614568b51889bbecade7c5dd2a84e7677f68ac86;hb=97c29aa2ee382a1d01b656bb61d2b8c0e9163d90;hp=e1fa68af31b61bc8293d58dbe01a0b7f1461d892;hpb=6f4ad200d1c99a1205b297638a3dcedb09ad3e6e;p=civicrm-core.git diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index e1fa68af31..614568b518 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; } @@ -235,13 +230,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 +257,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 +283,6 @@ class CRM_Core_Payment_BaseIPN { $this->cancelParticipant($participant->id); } - if ($transaction) { - $transaction->commit(); - } Civi::log()->debug("Setting contribution status to Cancelled"); return TRUE; } @@ -427,7 +416,7 @@ class CRM_Core_Payment_BaseIPN { 'related_contact' => $ids['related_contact'] ?? NULL, 'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL, 'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL, - ], $objects); + ], $objects['contribution']); } /**