Google::Checkout::Notification::NewOrder
use Google::Checkout::General::GCO; use Google::Checkout::Notification::NewOrder; use Google::Checkout::General::Util qw/is_gco_error/; my $xml = "/xml/new_order_notification.xml"; #-- #-- $xml can either be a file or a complete XML doc string #-- my $new_order = Google::Checkout::Notification::NewOrder->new(xml => $xml); die $new_order if is_gco_error $new_order; my $items = $new_order->get_items(); for my $item (@$items) { print $item->get_merchant_item_id,"\n", $item->get_name,"\n", $item->get_description,"\n", $item->get_price,"\n", $item->get_quantity,"\n"; }
Sub-class of Google::Checkout::Notification::GCONotification. When a new order notification is received, this module can be used to extract various information about the new order.
Google::Checkout::Notification::GCONotification
Constructor. Takes either a XML file or XML doc as data string. If the XML is invalid (syntax error for example), Google::Checkout::General::Error is returned.
Google::Checkout::General::Error
Always return Google::Checkout::XML::Constants::NEW_ORDER_NOTIFICATION.
Google::Checkout::XML::Constants::NEW_ORDER_NOTIFICATION
Returns the total of the order.
Returns the buyer ID.
Returns the fulfillment state. Since this is a new order, this will most likely be 'NEW'.
Returns the financial state. Since this is a new order, this will most likely be 'REVIEWING'.
Returns the string 'true' if marketing email is allowed. Otherwise, returns the string 'false'.
Returns various buyer info. SHIPPING_OR_BILLING can either be Google::Checkout::XML::Constants::GET_SHIPPING or Google::Checkout::XML::Constants::GET_BILLING to get buyer's shipping or billing data respectively. WHICH_DATA can be Google::Checkout::XML::Constants::BUYER_CONTACT_NAME, Google::Checkout::XML::Constants::BUYER_COMPANY_NAME, Google::Checkout::XML::Constants::BUYER_EMAIL, Google::Checkout::XML::Constants::BUYER_PHONE, Google::Checkout::XML::Constants::BUYER_FAX, Google::Checkout::XML::Constants::BUYER_ADDRESS1, Google::Checkout::XML::Constants::BUYER_ADDRESS2, Google::Checkout::XML::Constants::BUYER_CITY, Google::Checkout::XML::Constants::BUYER_REGION, Google::Checkout::XML::Constants::BUYER_POSTAL_CODE, Google::Checkout::XML::Constants::BUYER_COUNTRY_CODE.
Google::Checkout::XML::Constants::GET_SHIPPING
Google::Checkout::XML::Constants::GET_BILLING
Google::Checkout::XML::Constants::BUYER_CONTACT_NAME
Google::Checkout::XML::Constants::BUYER_COMPANY_NAME
Google::Checkout::XML::Constants::BUYER_EMAIL
Google::Checkout::XML::Constants::BUYER_PHONE
Google::Checkout::XML::Constants::BUYER_FAX
Google::Checkout::XML::Constants::BUYER_ADDRESS1
Google::Checkout::XML::Constants::BUYER_ADDRESS2
Google::Checkout::XML::Constants::BUYER_CITY
Google::Checkout::XML::Constants::BUYER_REGION
Google::Checkout::XML::Constants::BUYER_POSTAL_CODE
Google::Checkout::XML::Constants::BUYER_COUNTRY_CODE
Returns the string 'true' is merchant calculation is successful. Returns the string 'false' otherwise.
Returns the total tax applied to the new order.
Returns the adjustment total.
Returns the gift certificate calculated amount.
Returns the amount actually applied from using the gift certificate.
Returns the gift certificate code.
Returns the gift certificate message.
Returns the coupon calculated amount.
Returns the amount actually applied from using the coupon.
Returns the coupon code.
Returns the coupon message.
Returns the shipping method. If no shipping method is found, returns Google::Checkout::General::Error instead.
Returns the shipping name.
Returns the shipping cost.
Returns the expiration date of the shopping cart.
Returns the merchant private data.
Returns all items in the order. The items are returned as an array reference with each element a Google::Checkout::General::MerchantItem object.
Google::Checkout::General::MerchantItem
Copyright 2006 Google. All rights reserved.
To install Google::Checkout::XML::Writer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Google::Checkout::XML::Writer
CPAN shell
perl -MCPAN -e shell install Google::Checkout::XML::Writer
For more information on module installation, please visit the detailed CPAN module installation guide.