Announcing "My PHP Google Checkout"

I bet for many people looking to start an online store think of PayPal first. I remember when PayPal first debuted in 1998 when it fueled a renaissance in Internet commerce by enabling the long tail of retail - second hand and distressed merchandise. It really was revolutionary.

So nine years later, when it came time for me to build an online store to sell software, I did what everyone else did. I went to PayPal.

I downloaded their PHP library to assist developers like me in integrating with them and I was honestly shocked at what I found. The code I downloaded was incredibly difficult if not impossible to extend, which explains why this sample code feels like it had never evolved, never grown, never improved upon by more experienced developers.

The only question I was left with was "how could this happen?" How could the only library for one of the most popular scripting languages for a product that is so mature be so very, very bad?

smb_v1_logo_1_0.gifIt was that experience alone that spurred me to look at what many in the industry dubbed the "PayPal Killer" long before it was ever released: Google Checkout.

My first stop was to see if its sample PHP libraries were an improvement over PayPal's. They were - but to my dismay, their only PHP library was not compatible with PHP5, the latest version of the popular programming language.

I was heart broken. But I couldn't turn back to PayPal, not after having familiarized myself with Checkout's API. One can tell just by skimming their documentation that Checkout gives integrators the level of control over their customer's user experience to an extent that surprised me, because PayPal had conditioned me to believe that control over the buying process must be managed entirely by the purchasing system.

And then I did what I honestly didn't want to do - I decided to write my own Google Checkout PHP library - one that was compatible with PHP5.

hanging and shaking head I am such a fool.

But it had to be done. And if it was going to be a PHP5 library then it needed to embody the type of application a more fully object oriented scripting language was designed to create. The output? MyPHPGoogleCheckout.

MyPHPGoogleCheckout was designed to be a fully object oriented Payment Processing Client and Server. There is little need to extend the client, whose purpose is to help integrators build encrypted Google Checkout Buttons. The server is far more complex. It is a collection of abstract classes that routes and handles messages sent from Google to your payment processing back-end. These messages are sent as a customer moves through the purchasing process and their payment is processed. The MyPHPGoogleCheckout Server receives these messages and allows the integrator to engage the process to make key decisions like accepting and rejecting payment.

The library comes complete with several sample implementations of a Google Checkout Server, including a MySQL implementation that manages the state of a payment through a database, and maintains a detailed transaction log of all the messages sent and received by the server.

checkout.png

This library is the backbone of how purchases are managed on Test Run, and my hope is that it will help power other websites as well. But I need help. What I have implemented suits me just fine, but the implementation is far from complete. Indeed building a complete implementation of Google's API would be quite involved - and I don't have the time to undertake that. So if you are a developer, I could really use your help in finishing what I have started, and documenting what I have started.

For the rest of you - please feel free to take what I have created, which is at least enough to process a simple payment from beginning to end, and use it on your own site or project.

Resources

3 Comments

Thanks very much for creating this Byrne. I talked about your lib in the Checkout preso I gave at the Zend conference 2 weeks ago.

The "PHP sample code" project has been enhanced to support PHP5 as well as PHP4, but we're still fixing a few bugs before we announce that.

We use the classes from that project in OSCommerce and ZenCart integrations we are building.

Instead of having 2 separate projects each trying to implement all the API, would you be interested in merging the 2 projects? We'd be delighted to have you onboard.

One of our design goals is to support PHP4 and 5: how much of your code relies on PHP5 apart from the xml processing engine, that we isolated already?

We have been developing a PHP4 and PHP5 compatible library for PHP and Google Checkout. Our library was featured on code.google.com and has level2 support. If interested, perhaps you might find this library useful.

http://www.phpgcheckout.com

Thank you, Ron Howard

AOA i m new in php so i want to send me code for connecting my web page with google check out in php. Thanks

Leave a comment

what will you say?


Recent Comments

  • AOA i m new in php so i want to send me code for connecting my web page with google check out in php. Thanks ...

  • We have been developing a PHP4 and PHP5 compatible library for PHP and Google Checkout. Our library was featured on code.google.com and has level2 support. If interested, perhaps you might find this library useful. http...

  • Thanks very much for creating this Byrne. I talked about your lib in the Checkout preso I gave at the Zend conference 2 weeks ago. The "PHP sample code" project has been enhanced to support PHP5 as well as PHP4, but we'...

Close