WC_Gateway_Paypal_Request::get_paypal_state( string $cc, string $state )

Get the state to send to paypal.


Description Description


Parameters Parameters

$cc

(Required) Country two letter code.

$state

(Required) State code.


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/gateways/paypal/includes/class-wc-gateway-paypal-request.php

	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;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.