There is a lot going on when Magento actually sends a cart to Google Checkout, even more so if you are using Merchant calculated shipping. As a result lots of things can go wrong, with the merchant calculated shipping callback or with the actual server to server posting of the cart contents.
To help you with diagnosing problems I thought I’d shared my top 3 methods for finding out what is going wrong when Magento and Google Checkout are not communicating properly.
1) The Intergration Console
The first and most obvious place to try is the Google Checkout Intergration Console. As you can see in the screenshot below the console is hidden away in the Tools tab of the main seller dashboard. You’ll find it at the bottom of the left menu.
If the Google callbacks have failed or incorrect XML has been sent to Google you will find a report of the errors here. It is a good idea to keep an eye on the timestamps as you do not want to wind up chasing an old problem. It’s also good to periodically check this console while in production, just in case something starts to go wrong. I found when I upgraded to the latest Magento that the HTTPS callback was failing, but I hadn’t found it during development because I do not use SSL in development environments.
2) Checking the API Callback URL
This might seem obvious but if you are having problems with the API callbacks such as the Merchant Calculated Shipping callback, it really pays to actually make sure the URL you are using is the correct one. The URL will give a 404 response to an HTTP GET (such as wget or simply pasting the URL into a browser) because it responds only to the HTTP POST method. You can try a post quit simply on a command line using the wget tool with the –post-data=X option like this:
ashley@server:~$ wget --post-data=blah YOUR_MERCHANT_CALCULATED_SHIPPING_URL
Your URL is normally of the form:
The https is required in production environments with the non-sandbox Google Checkout and the [store directory] will not be required if your Magento store is installed at the root of your domain.
When you run the above wget command you would expect to see output like this:
HTTP request sent, awaiting response… 200 OK
You should not see output like:
HTTP request sent, awaiting response… 404 Not Found
This should help you to find out if the problem is to do with SSL, your actual URL path or even a simple typo when you entered the settings into the Google Checkout Integration settings page.
3) Checking The Google API Debug Log Table
There is a way to have Magento log all Google Checkout API messages to a database table. You need to first enable Google Checkout debugging in the Magento Configuration screen. You can find this under System>Configuration>Google API>Google Checkout. Set the ‘Debug’ option to Yes to enable XML message logging for all Google Checkout API communication.
The database table messages are logged to is
googlecheckout_api_debug. To find the latest message id and then inspect the messages you can use command line SQL like this:
-- To determine the last message id SELECT MAX(debug_id) FROM googlecheckout_api_debug; -- Choose values of X under or equal to the max id shown by the query above SELECT * FROM googlecheckout_api_debug WHERE debug_id = X;
You’ll need to refer closely to the Google Checkout API XML API documentation to find out what the XML API messages mean and why they are causing problems.
Hopefully these 3 diagnostic steps will help you get started when troubleshooting problems between Magento and Google Checkout. Although it can be difficult, it is a powerful combination and a very flexible API so it is worth investing time both getting the API to work and understanding how it works for future implementations.