David Shao Lin Zhuo > Google-Checkout-1.0.6 > Google::Checkout::General::TaxTableAreas

Download:
Google-Checkout-1.0.6.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
View Bugs
Report a bug
Source   Latest Release: Google-Checkout-1.1.1

NAME ^

Google::Checkout::General::TaxTableAreas

SYNOPSIS ^

  use Google::Checkout::XML::Constants;
  use Google::Checkout::General::TaxRule;
  use Google::Checkout::General::TaxTable;
  use Google::Checkout::General::TaxTableAreas;
  use Google::Checkout::General::MerchantCheckoutFlow;

  #--
  #-- Shipping tax set to 1 means shippings
  #-- are taxable and the rate is 2.5%. This
  #-- tax rule should apply to all 50 states
  #--
  my $tax_rule = Google::Checkout::General::TaxRule->new(
                 shipping_tax => 1,
                 rate => 0.025,
                 area => Google::Checkout::General::TaxTableAreas->new(
                         country => [Google::Checkout::XML::Constants::FULL_50_STATES]));

  #--
  #-- default tax table
  #--
  my $tax_table1 = Google::Checkout::General::TaxTable->new(
                   default => 1,
                   rules => [$tax_rule]);

  #--
  #-- same tax table but with a name
  #--
  my $tax_table2 = Google::Checkout::General::TaxTable->new(
                   default    => 0,
                   name       => "tax",
                   standalone => 1,
                   rules      => [$tax_rule]);

  my $checkout_flow = Google::Checkout::General::MerchantCheckoutFlow->new(
                      shipping_method       => [$flat_rate_shipping],
                      edit_cart_url         => "http://edit/cart/url",
                      continue_shopping_url => "http://continue/shopping/url",
                      buyer_phone           => "1-111-111-1111",
                      tax_table             => [$tax_table1,$tax_table2],
                      merchant_calculation  => $merchant_calculation);

DESCRIPTION ^

A sub-class of Google::Checkout::General::ShippingRestrictions. This module is responsible for creating tax table areas which can then be added to Google::Checkout::General::TaxRule.

new STATE => ..., ZIP => ..., COUNTRY => ...

Constructor. Takes array reference of state, zip code and country area where this tax table area will cover.

get_state

Returns an array reference of states.

add_state STATE

Adds another state.

get_zip

Returns an array reference of zip codes.

add_zip ZIP

Adds another zip code. Zip code might contains wildcard operator to specify a range of zip codes.

get_country

Returns the country area.

add_country COUNTRY_AREA

Adds another country area. Currently, only Google::Checkout::XML::Constants::FULL_50_STATES is supported.

COPYRIGHT ^

Copyright 2006 Google. All rights reserved.

SEE ALSO ^

Google::Checkout::General::TaxRule Google::Checkout::General::ShippingRestrictions