From f1fc9e7cf0736d4c9447b12a5350ce26bbf7210a Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 18 May 2020 18:12:03 +1200 Subject: [PATCH] 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 --- CRM/Core/Payment/PaymentExpressIPN.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } -- 2.25.1