Remove deprecated billingID from baseIPN
authorMatthew Wire <mjw@mjwconsult.co.uk>
Sat, 6 Jun 2020 14:30:11 +0000 (15:30 +0100)
committerMatthew Wire <mjw@mjwconsult.co.uk>
Tue, 9 Jun 2020 08:13:42 +0000 (09:13 +0100)
CRM/Core/Payment/AuthorizeNetIPN.php
CRM/Core/Payment/BaseIPN.php
CRM/Core/Payment/PayPalIPN.php
CRM/Core/Payment/PayPalProIPN.php

index 089c88572c0759cf610fe859611bd35cc92fffa5..7946ecacbe493b3d2a2089b57f176b752385fd7c 100644 (file)
@@ -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',
index 7153221524b7093850667f1ffd80255c0594c066..973fbd988894b02582d1d483917c7ee91e3e86f8 100644 (file)
@@ -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']));
index c241bf2b8e6e678c6222551b16a548af74d71956..be0424f7afd5cb3f3298f575ba970186659ade10 100644 (file)
@@ -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',
index 42951def3030f447963eb7dcb0aebc0bdc0d08de..d249aa0bef30b2d2a494358eda818db76a3c80e2 100644 (file)
@@ -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',