From 721e3ee4da810bf3ae4259f88a39a1a30df184ea Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 22 Dec 2023 09:58:05 +1300 Subject: [PATCH] Remove bltID as a parameter from getPaymentProcessorReadyAddressParams --- CRM/Contribute/BAO/Contribution.php | 4 ++-- CRM/Contribute/Form/AbstractEditPayment.php | 8 ++++---- CRM/Core/Form.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index e97ffe9b3e..9c465f9904 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -429,11 +429,11 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution im * To create an address we need state_province_id. * * @param array $params - * @param int $billingLocationTypeID * * @return array */ - public static function getPaymentProcessorReadyAddressParams($params, $billingLocationTypeID) { + public static function getPaymentProcessorReadyAddressParams($params) { + $billingLocationTypeID = CRM_Core_BAO_LocationType::getBilling(); [$hasBillingField, $addressParams] = self::getBillingAddressParams($params, $billingLocationTypeID); foreach ($addressParams as $name => $field) { if (substr($name, 0, 8) == 'billing_') { diff --git a/CRM/Contribute/Form/AbstractEditPayment.php b/CRM/Contribute/Form/AbstractEditPayment.php index 4d2e87b2ae..3c9e1f641b 100644 --- a/CRM/Contribute/Form/AbstractEditPayment.php +++ b/CRM/Contribute/Form/AbstractEditPayment.php @@ -554,15 +554,15 @@ class CRM_Contribute_Form_AbstractEditPayment extends CRM_Contact_Form_Task { foreach (array_keys($this->_fields) as $name) { $fields[$name] = 1; } - - $fields["address_name-{$this->_bltID}"] = 1; + $billingLocationID = CRM_Core_BAO_LocationType::getBilling(); + $fields["address_name-{$billingLocationID}"] = 1; //ensure we don't over-write the payer's email with the member's email if ($contactID == $this->_contactID) { - $fields["email-{$this->_bltID}"] = 1; + $fields["email-{$billingLocationID}"] = 1; } - [$hasBillingField, $addressParams] = CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams($this->_params, $this->_bltID); + [$hasBillingField, $addressParams] = CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams($this->_params); $fields = $this->formatParamsForPaymentProcessor($fields); if ($hasBillingField) { diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 6cab90d985..5e274dc666 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -1016,7 +1016,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { $params['country'] = $params["country-$billingLocationID"] = $params["billing_country-$billingLocationID"] = CRM_Core_PseudoConstant::countryIsoCode($params["billing_country_id-$billingLocationID"]); } - [$hasAddressField, $addressParams] = CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams($params, $this->_bltID); + [$hasAddressField, $addressParams] = CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams($params); if ($hasAddressField) { $params = array_merge($params, $addressParams); } -- 2.25.1