From e9a110215f37bdc33f08d6070a5f39b10f22be13 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Sat, 6 Jun 2020 15:30:11 +0100 Subject: [PATCH] Remove deprecated billingID from baseIPN --- CRM/Core/Payment/AuthorizeNetIPN.php | 6 +----- CRM/Core/Payment/BaseIPN.php | 2 ++ CRM/Core/Payment/PayPalIPN.php | 6 +----- CRM/Core/Payment/PayPalProIPN.php | 5 +---- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/CRM/Core/Payment/AuthorizeNetIPN.php b/CRM/Core/Payment/AuthorizeNetIPN.php index 089c88572c..7946ecacbe 100644 --- a/CRM/Core/Payment/AuthorizeNetIPN.php +++ b/CRM/Core/Payment/AuthorizeNetIPN.php @@ -205,7 +205,6 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { * @param array $input * @param array $ids * - * @return bool * @throws \CRM_Core_Exception */ public function getInput(&$input, &$ids) { @@ -230,10 +229,7 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { $input['trxn_id'] = md5(uniqid(rand(), TRUE)); } - if (!$this->getBillingID($ids)) { - return FALSE; - } - $billingID = $ids['billing']; + $billingID = $ids['billing'] = CRM_Core_BAO_LocationType::getBilling(); $params = [ 'first_name' => 'x_first_name', 'last_name' => 'x_last_name', diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index 7153221524..973fbd9888 100644 --- a/CRM/Core/Payment/BaseIPN.php +++ b/CRM/Core/Payment/BaseIPN.php @@ -487,6 +487,7 @@ class CRM_Core_Payment_BaseIPN { } /** + * @deprecated * Get site billing ID. * * @param array $ids @@ -494,6 +495,7 @@ class CRM_Core_Payment_BaseIPN { * @return bool */ public function getBillingID(&$ids) { + CRM_Core_Error::deprecatedFunctionWarning('CRM_Core_BAO_LocationType::getBilling()'); $ids['billing'] = CRM_Core_BAO_LocationType::getBilling(); if (!$ids['billing']) { CRM_Core_Error::debug_log_message(ts('Please set a location type of %1', [1 => 'Billing'])); diff --git a/CRM/Core/Payment/PayPalIPN.php b/CRM/Core/Payment/PayPalIPN.php index c241bf2b8e..be0424f7af 100644 --- a/CRM/Core/Payment/PayPalIPN.php +++ b/CRM/Core/Payment/PayPalIPN.php @@ -381,17 +381,13 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { * @throws \CRM_Core_Exception */ public function getInput(&$input, &$ids) { - if (!$this->getBillingID($ids)) { - return; - } - + $billingID = $ids['billing'] = CRM_Core_BAO_LocationType::getBilling(); $input['txnType'] = $this->retrieve('txn_type', 'String', FALSE); $input['paymentStatus'] = $this->retrieve('payment_status', 'String', FALSE); $input['invoice'] = $this->retrieve('invoice', 'String', TRUE); $input['amount'] = $this->retrieve('mc_gross', 'Money', FALSE); $input['reasonCode'] = $this->retrieve('ReasonCode', 'String', FALSE); - $billingID = $ids['billing']; $lookup = [ "first_name" => 'first_name', "last_name" => 'last_name', diff --git a/CRM/Core/Payment/PayPalProIPN.php b/CRM/Core/Payment/PayPalProIPN.php index 42951def30..d249aa0bef 100644 --- a/CRM/Core/Payment/PayPalProIPN.php +++ b/CRM/Core/Payment/PayPalProIPN.php @@ -493,9 +493,7 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr * @throws CRM_Core_Exception */ public function getInput(&$input, &$ids) { - if (!$this->getBillingID($ids)) { - return; - } + $billingID = $ids['billing'] = CRM_Core_BAO_LocationType::getBilling(); $input['txnType'] = self::retrieve('txn_type', 'String', 'POST', FALSE); $input['paymentStatus'] = self::retrieve('payment_status', 'String', 'POST', FALSE); @@ -503,7 +501,6 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr $input['amount'] = self::retrieve('mc_gross', 'Money', 'POST', FALSE); $input['reasonCode'] = self::retrieve('ReasonCode', 'String', 'POST', FALSE); - $billingID = $ids['billing']; $lookup = [ "first_name" => 'first_name', "last_name" => 'last_name', -- 2.25.1