Recent Weblogs

Links I like

Setting up your gCartEncoder

This tutorial is to assume you already have downloaded the gCartEncoder library and have stashed somewhere on your web server

Include the library in the page you need Google Checkout buttons

Include code similar to this at the top of the document. You will probably need to modify the path but that will get you close.

Now that the library's functionality is available you need to create your factory object and send an argument to the file containing your base64 encoded document.
$myEncoder = new gCartEncoder("s3cure.txt");
We have now instantiated an object of the gCartEncoder class, and it has your signature ready and we can start creating carts. To create a cart we access the "createCart" method from the $myEncoder object.
$myProduct = $myEncoder -> createCart("products/product.xml");

Now we've created an instance of gCart by using the createCart method and we've saved that as the $myProduct variable. Last step is to put it in the HTML somewhere the user can get at it. When you go to print just reference the "htmlCart" property and that will contain the checkout button that is ready to go.

echo $myProduct -> htmlCart;

And there you have it, a Google checkout enabled checkout button all signed sealed and ready to deliver.