Skip to content
Snippets Groups Projects
Commit 6ccd9ac7 authored by mattwire's avatar mattwire
Browse files

Remove unused function

parent 7c0d268a
Branches
Tags
No related merge requests found
......@@ -302,46 +302,6 @@ trait CRM_Core_Payment_MJWTrait {
return isset($this->_paymentProcessor['is_test']) && $this->_paymentProcessor['is_test'] ? 1 : 0;
}
/**
* Format the fields for the payment processor.
* @fixme Copied from CiviCRM Core 5.13. We should remove this when all forms submit using this function (eg updateSubscriptionBillingInfo)
*
* In order to pass fields to the payment processor in a consistent way we add some renamed
* parameters.
*
* @param array $fields
*
* @return array
*/
private function formatParamsForPaymentProcessor($fields) {
$billingLocationId = CRM_Core_BAO_LocationType::getBilling();
// also add location name to the array
$this->_params["address_name-{$billingLocationId}"] = ($this->_params['billing_first_name'] ?? '') . ' ' . ($this->_params['billing_middle_name'] ?? '') . ' ' . ($this->_params['billing_last_name'] ?? '');
$this->_params["address_name-{$billingLocationId}"] = trim($this->_params["address_name-{$billingLocationId}"]);
// Add additional parameters that the payment processors are used to receiving.
if (!empty($this->_params["billing_state_province_id-{$billingLocationId}"])) {
$this->_params['state_province'] = $this->_params["state_province-{$billingLocationId}"] = $this->_params["billing_state_province-{$billingLocationId}"] = CRM_Core_PseudoConstant::stateProvinceAbbreviation($this->_params["billing_state_province_id-{$billingLocationId}"]);
}
if (!empty($this->_params["billing_country_id-{$billingLocationId}"])) {
$this->_params['country'] = $this->_params["country-{$billingLocationId}"] = $this->_params["billing_country-{$billingLocationId}"] = CRM_Core_PseudoConstant::countryIsoCode($this->_params["billing_country_id-{$billingLocationId}"]);
}
[$hasAddressField, $addressParams] = CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams($this->_params, $billingLocationId);
if ($hasAddressField) {
$this->_params = array_merge($this->_params, $addressParams);
}
$nameFields = ['first_name', 'middle_name', 'last_name'];
foreach ($nameFields as $name) {
$fields[$name] = 1;
if (array_key_exists("billing_$name", $this->_params)) {
$this->_params[$name] = $this->_params["billing_{$name}"];
$this->_params['preserveDBName'] = TRUE;
}
}
return $fields;
}
/**
* Handle an error and notify the user
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment