From: eileen Date: Mon, 18 May 2020 06:12:03 +0000 (+1200) Subject: Remove instantiation of transaction from payment express ipn class X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f1fc9e7cf0736d4c9447b12a5350ce26bbf7210a;p=civicrm-core.git Remove instantiation of transaction from payment express ipn class This class is hopefully used, however, this change should be safe regardless as it just calls the same function without needlessly instantiating the parent. Note this processor is not enabled on install or recommended --- diff --git a/CRM/Core/Payment/PaymentExpressIPN.php b/CRM/Core/Payment/PaymentExpressIPN.php index ab34ea13f1..1bac6b1f9b 100644 --- a/CRM/Core/Payment/PaymentExpressIPN.php +++ b/CRM/Core/Payment/PaymentExpressIPN.php @@ -109,6 +109,8 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN { * @param $transactionReference * * @return bool + * @throws \CRM_Core_Exception + * @throws \CiviCRM_API3_Exception */ public function newOrderNotify($success, $privateData, $component, $amount, $transactionReference) { $ids = $input = $params = []; @@ -160,8 +162,6 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN { return FALSE; } - $transaction = new CRM_Core_Transaction(); - // check if contribution is already completed, if so we ignore this ipn if ($contribution->contribution_status_id == 1) { @@ -181,7 +181,7 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN { $contribution->trxn_id = $ids['membership']; } } - $this->completeTransaction($input, $ids, $objects, $transaction); + CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $objects); return TRUE; }