The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Google::Checkout::General::ShoppingCart

SYNOPSIS

  use Google::Checkout::General::GCO;
  use Google::Checkout::General::ShoppingCart;
  use Google::Checkout::General::Util qw/is_gco_error/;

  my $cart = Google::Checkout::General::ShoppingCart->new(
             expiration    => "+1 month",
             private       => "Private data",
             checkout_flow => $checkout_flow);

  my $response = Google::Checkout::General::GCO->new->checkout($cart);

  die $response if is_gco_error $response;

  #--
  #-- Redirect URL
  #--
  print $response,"\n";

DESCRIPTION

This module is responsible for writing the <shopping-cart> XML.

new EXPIRATION => ..., PRIVATE => ..., CHECKOUT_FLOW => ...

Constructor. EXPIRATION can be any valid date/time string recognized by Date::Manip. PRIVATE can be any custom private data provided by the merchant. CHECKOUT_FLOW should be a Google::Checkout::General::MerchantCheckoutFlow object.

get_expiration

Returns the expiration time for this shopping cart.

set_expiration DATE_TIME_STRING

Sets the expiration date for this shopping cart. DATE_TIME_STRING can be anything recognized by the Date::Manip module. perldoc Date::Manip for more detail.

get_private

Returns the private data (as array reference).

add_private PRIVATE_DATA

Adds another private data to the shopping cart.

get_items

Returns all the merchant items added to this shopping cart so far. It's returned as an array reference where each element is an object of Google::Checkout::General::MerchantItem.

add_item ITEM

Adds another merchant item to the shopping cart. ITEM should be an object of Google::Checkout::General::MerchantItem.

get_checkout_flow

Returns the Google::Checkout::General::MerchantCheckoutFlow object.

set_checkout_flow

Sets the Google::Checkout::General::MerchantCheckoutFlow object.

COPYRIGHT

Copyright 2006 Google. All rights reserved.

SEE ALSO

Google::Checkout::General::MerchantItem Google::Checkout::General::MerchantCheckoutFlow