Recent Weblogs

Links I like

gCartEncoder, 3 Steps to Google Checkout success

gCartEncoder is a PHP Library that allows an easy 3 step process of implementation to get your products available to Google Checkout customers!

Step One, Create your products

The gCartEncoder reads XML documents that follow the checkout XML schema. Follow Google's instructions to create a valid shopping cart and place it in a directory. It is advisable to create all of your products in a directory so that you can easily iterate over your "store" and produce the shopping items.

Step Two, Hide your secrets

Checkout requires authentication, so we've got to store that information somewhere. XML once again is our method of choice but we can't leave that in plain text. It would be best to have further security but gCartEncoder must receive an XML document in a base64 encoded string, it will decode this and parse it as an XML document. The "schema" for this is very simple, it lends itself to what it is, a key and an id.

<root>
    <key>289170MYKEY2987305</key>
    <id>273598MYID237</id>
</root>
							
If you need assistance base64 encoding something I have provided a tool to help you in that matter. Save the returned string in a text file and place it somewhere safe.

Step Three, Use gCartEncoder on a PHP enabled page

Once your products are stored and your secret is stashed its time to implement! Download the gCartEncoder library and place it on your PHP 5 enabled web server. Follow the API instructions to get things hooked up. The brief breakdown is create a "factory" object that reads your secret file. It creates your Google Checkout signature and then allows you to read your XML Product files and produce carts already stamped with the signature and all of the pricing details and other descriptors in a simple HTML form that enables users a one click shopping experience.