PayPal Pro missing parameters (add standard getters)
Overview
state_province, country and ip_address are not always set properly for paypal pro due to inconsistency with parameters being passed. https://github.com/civicrm/civicrm-core/pull/12038
Before
state_province, country and ip_address may not be passed to payment processor.
After
This applies to ALL payment processors:
- If state_province and country were passed from the payment form in one way or another, they will be presented in a consistent format to the payment processor.
- Add client ip_address to the list of parameters so payment processors don't have to retrieve this manually if they require it (paypal pro wants it but was not retrieving it).
Technical Details
This PR adds three generic "getters" to CRM_Core_Payment per @eileenmcnaughton suggestion. For compatibility, no parameters are removed but additional parameters may be set depending on what is passed in. For example if only country_id is defined, then country will be set as well.
Comments
This fixes a real issue identified with the paypal pro processor in core, but the inconsistency of parameters passed affects other processors and means each processor has to do extra coding to make sure that the parameters are in the right format when they are passed in. See for example: https://civicrm.stackexchange.com/questions/24316/paypal-pro-billing-address-state-province-country-not-being-passed