🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Google checkout

Published August 11, 2006
Advertisement
Wrestling with Google Checkout order processing. It's more powerful than PayPal and gives you a few more capabilities that I'll never use, like the ability to validate shipping costs, tax tables, and coupon codes from within Google's shopping cart page.

Also, their security is ponderous. Paypal's was pretty simple. You'd get a notification from Paypal that somebody's buying something. In that notification, they'd send you a bigass random string as a token. You'd then send that token back to Paypal as your way of saying "did you really send this order to me?". If it send you back "VERIFIED", then the order was indeed sent from Paypal and not from someone trying to fake out your processing code.

Google Checkout wants everything in XML and encrypted. I could probably write the encryptor in ActionScript, but I took the easy way out and sent my cart-contents to some PHP code that'd send it along to Google, as Google already had the stuff written out in PHP as a sample app. I used the PHP CURL stuff so that I could transparently massage my shopping cart into something google-friendly and then send it to 'em.


Biggest problem now is how Google sends me back the verification that the charge happened. It's similar to Paypal in that there's a little piece of back-end code you write. And, unlike Paypal, Google sends you the stuff as XML rather than a CGI post, as that makes things needlessly complicated.

The hassle is how Google sends you stuff. Basically everything gets sent separately. I'll get stuff like this. . .

"Hey codezone. User zippy@zippy.com wants to buy item PP1 for $9.95. I'm calling it transaction number 1344."

This is pretty-much all I need to verify and send you a game. But I can't send it to you yet. All that means is that someone INITIATED a transaction. Not that the transaction went through.

A few seconds later, google will call me again to say. . .

"Hey codezone. Transaction number 1344 is now set to chargeable."

That means that I'll be getting my money, so this is the important notification. Unfortunately, this notification doesn't tell me what the user bought. It only tells me the order number and that the status has changed. That means that I have to save the first transaction above somewhere and just wait until its status changes.

IIRC, Paypal does the same thing, but paypal sends along all of the item numbers and prices again. That way I can ignore the first packet entirely because, frankly, I couldn't much care if someone starts to buy something and then doesn't finish.

So basically I'm gonna need to store partially completed transactions.
Next Entry New software
0 likes 2 comments

Comments

noaktree
This sounds like a big hassle. I've considered adding the new google payments to my site but I think I'll wait a while longer. I don't want to keep track of partial checkouts!
August 11, 2006 03:34 PM
jbadams
Damn, looks like it would meet my needs nicely (I'll be tracking incomplete transactions anyway), but it's only available to US merchants for now.
August 12, 2006 01:21 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement