WC_Gateway_Paypal::get_icon_url PHP Method

get_icon_url() protected method

Get the link for an icon based on country.
protected get_icon_url ( string $country ) : string
$country string
return string
    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');
        $countries = array('DZ', 'AU', 'BH', 'BQ', 'BW', 'CA', 'CN', 'CW', 'FI', 'FR', 'DE', 'GR', 'HK', 'IN', '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)) {
            return $url . '/webapps/mpp/home';
        } elseif (in_array($country, $countries)) {
            return $url . '/webapps/mpp/paypal-popup';
        } else {
            return $url . '/cgi-bin/webscr?cmd=xpt/Marketing/general/WIPaypal-outside';
        }
    }