
Google::Checkout::General::ShippingRestrictions

use Google::Checkout::XML::Constants;
use Google::Checkout::General::ShippingRestrictions;
use Google::Checkout::General::MerchantCalculatedShipping;
my $restriction = Google::Checkout::General::ShippingRestrictions->new(
allowed_zip => ["94*"],
allowed_postal_area => [Google::Checkout::XML::Constants::EU_COUNTRIES],
excluded_zip => ["90*"],
excluded_country_area => [Google::Checkout::XML::Constants::FULL_50_STATES]);
my $custom_shipping = Google::Checkout::General::MerchantCalculatedShipping->new(
price => 45.99,
restriction => $restriction,
shipping_name => "Custom shipping");

This module is used to define shipping address-filters or restrictions which can then be added as part of a shipping method. Also, TaxTableAreas.pm is also a subclass of this module.
This is a constant array storing all the EU country codes: 'AT', 'BE', 'BG', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'UK'
To view all the country codes in the command-line: perl -MGoogle::Checkout::General::ShippingRestrictions -le 'print join(", ", Google::Checkout::General::ShippingRestrictions::EU_COUNTRIES)'
Constructor. Takes a hash as its argument with the following keys: ALLOWED_STATE, array reference of allowed states; ALLOWED_ZIP, array reference of allowed zip code; ALLOWED_COUNTRY_AREA, array reference of allowed country area; EXCLUDED_STATE, array reference of excluded states; EXCLUDED_ZIP, array reference of excluded zip codes; EXCLUDED_COUNTRY_AREA, array reference of excluded country area; ALLOWED_ALLOW_US_PO_BOX, true or false to enable PO Box addresses; ALLOWED_WORLD_AREA true or false to enable international shipping; ALLOWED_POSTAL_AREA, array reference of allowed countries. For ALLOWED_ZIP and EXCLUDED_ZIP, it's possible to use the wildcard operator (*) to specify a range of zip codes as in "94*" for all zip codes starting with "94".
Returns the allowed states (array reference).
Adds another allowed state.
Returns the allowed zip codes (array reference).
Adds another allowed zip code. Zip code can have the wildcard operator to specify a range of zip codes.
Returns the allowed US country area (array reference).
Adds an allowed US country area.
Returns true, false, or undefined if this has not been set
Set whether or not US PO Box addresses are allowed
Returns true or undefined
Enables international shipping by setting the world_area value
Returns the allowed postal area (array reference).
Add a postal area
Returns the excluded states (array reference).
Adds another excluded state.
Returns the excluded zip codes (array reference).
Adds another excluded zip code. Zip code can have the wildcard operator to specify a range of zip codes.
Returns the excluded US country areas (array reference).
Adds another excluded US country area.

Copyright 2006 Google. All rights reserved.