protected function isAddressInGeoZone(array $order, $addressType, $geoZoneId)
    {
        $fallbackAddressType = $addressType === 'payment' ? 'shipping' : 'payment';
        if (!empty($order["{$addressType}_country_id"])) {
            $countryId = $order["{$addressType}_country_id"];
            $zoneId = !empty($order["{$addressType}_zone_id"]) ? $order["{$addressType}_zone_id"] : 0;
        } elseif (!empty($order["{$fallbackAddressType}_country_id"])) {
            $countryId = $order["{$fallbackAddressType}_country_id"];
            $zoneId = !empty($order["{$fallbackAddressType}_zone_id"]) ? $order["{$fallbackAddressType}_zone_id"] : 0;
        } else {
            $countryId = 0;
            $zoneId = 0;
        }

        $zones = $this->getZoneToGeoZones($geoZoneId);
        foreach ($zones as $zone) {
            // Check if this zone definition covers the same country.
            if ($zone['country_id'] == $countryId) {
                // Check if the zone definition covers the whole country or if
                // they are equal.
                if ($zone['zone_id'] == 0 || $zone['zone_id'] == $zoneId) {
                    return true;
                }
            }
        }
        return false;
    }