This document is a step-by-step procedure instructing you on how to integrate Google Checkout with your custom order processing system. It assumes that you have an existing order processing system and want to integrate Google Checkout using the HTML API. As explained below, integrating requires programming skills to modify your server code.
Objective: When you're done, you'll be able to receive and handle Google Checkout orders in an automated manner.
This procedure uses the HTML API. If you're unsure whether you should be using the HTML or XML API, see Choosing Between HTML and XML API
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTMLorXML_Processing.html).
Will this procedure work for my site?
Procedure Summary:
Assumptions:
(http://code.google.com/apis/checkout/developer/Google_Checkout_Comparison_Part_I.html).
(http://checkout.google.com/support/sell/bin/answer.py?hl=en&answer=57856)(Required for Notification API)
(http://code.google.com/apis/checkout/developer/Google_Checkout_Glossary.html#http_basic_authentication)(Required for Notification API)Technical Skills Required:
This symbol
means the link opens up the page in a new window or tab so when you're done with that step, you can close the window or tab and return to the next step.
Configure your server's basic authentication.
You'll need to configure basic authentication on this server to accept your Merchant ID and Merchant Key as a login and password. You may wish to ask your hosting provider or review your server instructions for configuration details, as they will differ for each server software.
Install a Google Checkout-accepted SSL certificate.
The currently accepted root certificates can be found in the following list: Accepted SSL Certificates
(http://checkout.google.com/support/sell/bin/answer.py?hl=en&answer=57856). As certificate names don't always indicate their root certificate, you may need to check with the certificate provider.
Once your certificate is installed, you can check whether you return the entire certificate chain correctly by running the following command (with your actual website domain) in Unix, or after downloading OpenSSL for Windows:
openssl s_client -connect {website domain}:443 -showcerts < /dev/null
If your certificate hierarchy isn't correct, you won't be able to accept notifications from Google Checkout.
Note: This step can be performed by using the Notification API
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Notification_API.html), the Notification History API, or the Polling API. This document will cover the most common method, the Notification API, which provides real-time notifications of new orders and order state changes.
Here are the typical messages associated with an order:
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Notification_API.html#new_order_notifications) informs you of new orders that have been submitted through Google Checkout.
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Notification_API.html#risk_information_notification) provides financial information about a transaction to help you ensure that an order is not fraudulent.
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Notification_API.html#order_state_change_notification) signals an update to an order's financial status or its fulfillment status.
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Notification_API.html#amount_notifications) informs you that a charge, refund, chargeback or credit card authorization has been processed for an order. These notifications also identify the amount of the transaction.The New Order Notification comes first; other notifications can be in any order.
The steps you will need to do are:
Receive and parse notifications
You first need to handle the New Order, Risk, and Order State Change notifications. These notifications will provide information about the order state, order contents, and buyer.
Your server will need to receive and parse these notifications for the information that's pertinent to your order processing system. You can leverage our client libraries
(http://code.google.com/apis/checkout/samplecode.html) to help handle these notifications.
The possible order state changes are defined by financial-order-state
(http://code.google.com/apis/checkout/Google_Checkout_HTML_API_Parameter_Reference.html#tag_financial-order_state) and fulfillment-order-state
(http://code.google.com/apis/checkout/Google_Checkout_HTML_API_Parameter_Reference.html#tag_fulfullment-order-state).
Values for financial-order-state include:
Values for fulfillment-order-state include:
You can use this financial-order-state and fullment-order-state to determine how and when to process an order. For example, when the financial-order-state becomes chargeable, you can send the charge-order
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Financial_Commands.html#Charge_Order) request to capture payment.
Store information from the notification and determine the appropriate response
Once the notification has been parsed, you need to create custom logic to store the necessary information and process the order accordingly. For example, a New Order Notification should cause the creation of that order in your database.
The typical notification flow for an order is shown in the following diagram. To read details about the steps in this diagram, see Typical order flow
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Processing.html#typical_order_flow).

Take a look at the Notification API
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Notification_API.html) for more details on what parameters the notifications might include.
Once an order becomes chargeable, and the order is ready to ship, send the charge-order
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Financial_Commands.html#Charge_Order) request to the appropriate order processing URL, with the string MERCHANT_ID replaced with your actual numeric Merchant ID:
Sandbox:
https://sandbox.google.com/checkout/api/checkout/v2/requestForm/Merchant/MERCHANT_ID
Production:
https://checkout.google.com/api/checkout/v2/requestForm/Merchant/MERCHANT_ID
NOTE: You should do all your testing in a sandbox environment. Remember that you will have different Merchant IDs for your production and sandbox accounts.
Charging the order prompts Google Checkout to actually collect funds from the buyer, and will schedule a payout to you if the charge is successful.
You can view sample code
(http://code.google.com/apis/checkout/samplecode.html) for examples on issuing charge-order requests.
Receive an order-state-change-notification
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Notification_API.html#order_state_change_notification) with a new-financial-order-state
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Parameter_Reference.html#tag_new-financial-order-state) of CHARGED (which confirms the charge was completed successfully) and a charge-amount-notification
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Notification_API.html#charge_amount_notification) (which specifies how much money was charged) for the charged amount.
Ship the order within 24 hours and send a deliver-order
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Order_Level_Shipping.html#Deliver_Order) command to update the fulfillment status with Google Checkout. By default, this command will provide an email update to the buyer.
Receive an order-state-change-notification with a new-fulfillment-order-state
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Parameter_Reference.html#tag_new-fulfillment-order-state) of DELIVERED to confirm that Google Checkout successfully received the deliver-order request.
Once the order is completely fulfilled, send the archive-order
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Archiving_Commands.html#Archive_Order) request.
For more details on specific commands, see:
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Financial_Commands.html)
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Line_Item_Shipping.html)
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Order_Level_Shipping.html)
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Archiving_Commands.html)While most orders are complete by this stage, some may be returned, need to be refunded, or become charged back.
To handle a refund, you'll need to:
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Financial_Commands.html#Refund_Order) request. You can refund all or part of an order.
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Line_Item_Shipping.html#Return_Items) command.
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Notification_API.html#refund_amount_notification).If the refund is for the complete order, you can issue a cancel-order
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Financial_Commands.html#Cancel_Order) request to the same effect.
If an order becomes charged back, you'll receive a chargeback-amount-notification
(http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Notification_API.html#chargeback_amount_notification).
To test your Google Checkout implementation, be sure to use the sandbox server URL with your sandbox Merchant ID when sending commands, then try some end-to-end orders and check the following is true:
If you experience any problems, you can check the Integration Console
(https://sandbox.google.com/checkout/sell/settings?section=IntegrationConsole) in your sandbox Merchant Center to view a log of any API error and warning messages.
If you've been using the sandbox, you need to make the following changes:
https://checkout.google.com/api/checkout/v2/requestForm/Merchant/MERCHANT_IDOnce you're sure you can fulfill orders, go ahead and push your site live.
Congratulations!
After a buyer has placed an order, you have shipped it to them and charged their card, Google then pays you that amount minus a transaction fee. To find out about payment prerequisites and schedules, see:
(http://checkout.google.com/support/sell/bin/answer.py?hl=en&answer=25400)
(http://checkout.google.com/support/sell/bin/answer.py?hl=en&answer=89800)
(http://checkout.google.com/support/sell/bin/topic.py?topic=12167)