WC_Gateway_Paypal_Request::get_paypal_state
Get the state to send to paypal.
Method of the class: WC_Gateway_Paypal_Request{}
No Hooks.
Returns
String.
Usage
// protected - for code of main (parent) or child class $result = $this->get_paypal_state( $cc, $state );
- $cc(string) (required)
- Country two letter code.
- $state(string) (required)
- State code.
WC_Gateway_Paypal_Request::get_paypal_state() WC Gateway Paypal Request::get paypal state code WC 10.8.1
protected function get_paypal_state( $cc, $state ) {
if ( 'US' === $cc ) {
return $state;
}
$states = WC()->countries->get_states( $cc );
if ( isset( $states[ $state ] ) ) {
return $states[ $state ];
}
return $state;
}