GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Google::Checkout::General::MerchantCalculations(3) User Contributed Perl Documentation Google::Checkout::General::MerchantCalculations(3)

Google::Checkout::General::MerchantCalculations

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

  my $merchant_calculation = Google::Checkout::General::MerchantCalculations->new(
                             url          => "http://callback/url",
                             coupons      => 1,
                             certificates => 1);

  my $checkout_flow = Google:::Checkout::General::MerchantCheckoutFlow->new(
                      shipping_method       => [$method],
                      edit_cart_url         => "http://edit/cart/url",
                      continue_shopping_url => "http://continue/shopping/url",
                      buyer_phone           => "1-111-111-1111",
                      tax_table             => [$table1, $table2],
                      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 = Google::Checkout::General::GCO->new->checkout($cart);

  die $response if is_gco_error($response);

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

This module is responsible for writing the <merchant-calculations> XML element.
new URL => ..., COUPONS => ..., CERTIFICATES => ...
Constructor. The URL argument should be a link for merchant calculation. The COUPONS and CERTIFICATES arguments should be either a true or false value to signal whether coupons and gift certificates are supported or not.
get_url
Returns the callback URL.
set_url URL
Sets the callback URL.
get_coupons
Returns the string "true" if coupons are supported. Otherwise, returns the string "false".
set_coupons FLAG
Enable (if FLAG is true) or disable (if FLAG is false) coupon support.
get_certificates
Returns the string "true" if gift certificates are supported. Otherwise, returns the string "false".
set_certificates FLAG
Enable (if FLAG is true) or disable (if FLAG is false) gift certificate support.

Copyright 2006 Google. All rights reserved.
2007-09-28 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.