WordPress at Your Fingertips
function is not described

WC_Gateway_Paypal_Request::get_paypal_state() protected WC 1.0

Get the state to send to paypal.

{} It's a method of the class: WC_Gateway_Paypal_Request{}

No Hooks.

Return

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.

Code of WC_Gateway_Paypal_Request::get_paypal_state() WC 5.7.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;
}