WC_Gateway_Paypal::get_icon_url( string $country )
Get the link for an icon based on country.
Description Description
Parameters Parameters
- $country
-
(Required) Country two letter code.
Return Return
(string)
Source Source
File: includes/gateways/paypal/class-wc-gateway-paypal.php
protected function get_icon_url( $country ) { $url = 'https://www.paypal.com/' . strtolower( $country ); $home_counties = array( 'BE', 'CZ', 'DK', 'HU', 'IT', 'JP', 'NL', 'NO', 'ES', 'SE', 'TR', 'IN' ); $countries = array( 'DZ', 'AU', 'BH', 'BQ', 'BW', 'CA', 'CN', 'CW', 'FI', 'FR', 'DE', 'GR', 'HK', 'ID', 'JO', 'KE', 'KW', 'LU', 'MY', 'MA', 'OM', 'PH', 'PL', 'PT', 'QA', 'IE', 'RU', 'BL', 'SX', 'MF', 'SA', 'SG', 'SK', 'KR', 'SS', 'TW', 'TH', 'AE', 'GB', 'US', 'VN' ); if ( in_array( $country, $home_counties, true ) ) { return $url . '/webapps/mpp/home'; } elseif ( in_array( $country, $countries, true ) ) { return $url . '/webapps/mpp/paypal-popup'; } else { return $url . '/cgi-bin/webscr?cmd=xpt/Marketing/general/WIPaypal-outside'; } }