Thursday 7 June 2007

Google Checkout Integration

I had some difficulties with integrating with my shopping cart software with Google Checkout. With PayPal it was easy — I just got my program to modify the code for one of the 'Buy Now' buttons. Unfortunately, the Google Checkout button code is encrypted which means I would have to produce a different button for every one of my items.

So I tried using Google's API sample code, but the test URL was not recognised and the live code produced an error. I gave up on trying the sandbox (test area) and concentrated on getting the live code to work. After delving deeper into the Developers' Handbook, I have managed to sort the problem out:

The samples Google give are for a US shopping basket but as my account is in Pounds stirling the orders were rejected. The US Dollar is the default currency so the code to define the currency was not included in the sample. I managed to solve the problem by two lines of code. Please see my article on Google Checkout Intergation for more information and code examples.