* 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_') {
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) {
$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);
}