Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

/var/sites/help-site.com/auto/tmp/CPAN/9677/Google-Checkout-1.1.1/lib/Google/Checkout/General/GiftCertificate.pm

/var/sites/help-site.com/auto/tmp/CPAN/9677/Google-Checkout-1.1.1/lib/Google/Checkout/General/GiftCertificate.pm


NAME

Google::Checkout::General::GiftCertificate


SYNOPSIS


  use Google::Checkout::General::GCO;

  use Google::Checkout::General::GiftCertificate;

  use Google::Checkout::General::MerchantCalculations;

  use Google::Checkout::General::MerchantCheckoutFlow;

  use Google::Checkout::General::ShoppingCart;

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

  my $gco = Google::Checkout::General::GCO->new;

  my $gift_certificate = Google::Checkout::General::GiftCertificate->new(

                         accepted => 1, name => 'My company', pin => 123456789);

  my $merchant_calculation = Google::Checkout::General::MerchantCalculations->new(

                             url => 'http://callback/url', certificates => $gift_certificate);

  my $checkout_flow = Google::Checkout::General::MerchantCheckoutFlow->new(

                      edit_cart_url         => "http://edit/cart/url";,

                      continue_shopping_url => "http://continue/shopping/url";,

                      merchant_calculation  => $merchant_calculation);

  my $cart = Google::Checkout::General::ShoppingCart->new(

             expiration    => "+1 month",

             private       => "Private data",

             checkout_flow => $checkout_flow);

  $cart->add_item($item1);

  $cart->add_item($item2);

  my $response = $gco->checkout($cart);

  die $response if is_gco_error($response);

  #--

  #-- redirect URL

  #--

  print $response,"\n";


DESCRIPTION

Support gift certificates.

new accepted => [1 or 0], name => 'name of the gift certificate', pin => [require PIN or not]
Constructor. `accepted' should be a true or false value specifying to support gift certificate or not. If `accepted' is false, `name' and `pin' are both ignored. If `accepted' is true, `name' specify the name of the gift certificate. This is what the user will see next to the text field where the customer is expected to enter the gift certificate number. If `pin' is true, it tells Checkout that the customer must enter a PIN with the gift certificate.

set_accepted
Sets to accept gift certification or not.

get_accepted
Returns true if gift certificate could be used or false otherwise.

set_name
Sets the name of the gift certificate.

get_name
Returns the name of the gift certificate.

set_pin
Sets the PIN for the gift certificate.

get_pin
Returns the PIN of the gift certificate.


COPYRIGHT

Copyright 2006 Google. All rights reserved.

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy