Jump to content
Sign in to follow this  
stevemills

GBuy... who is working on a Mod?

Recommended Posts

Hey guys,

 

I hacked up abbat's code to compute the cheapest shipping method and pass it on to Google as a default-flat-rate. It does the same for tax. In keeping with Google's mandate that no login be required before offering Google Checkout, I stuck the whole order summary on the "View Shopping Cart" page, along with the Google Checkout button. The tax is hidden on this summary because we don't have the user's location, but the tax configuration details are read from OSc's Tax Zones and Tax Rates and passed on to Google Checkout. I then configured Checkout's Callback URL to point to a script that collects order and customer information from Google and sticks it into OSc's order and customer tables.

 

All in all, I'm pretty happy with the hacks -- my site no longer requires users to log in, and an entire purchase takes two clicks: one on the Google Checkout button on my "View Shopping Cart" page, and one on the actual Google Checkout page after the user has entered his information.

 

What are your thoughts? Is there documentation on how I could wrap up a module with this stuff?

 

Hey man,

 

This contrib is small. Very small. You're right. It does not include everything it should (and should it at all?)

Google API supports everything, besides the Tax, shipping - which is VERY EASY TO ADD - it also support order processing, status, notifications etc. Shipping and taxes are the simpe thing - same simple as top build the google shopping cart.

 

40 lines of code - you're right. I can tell with 100% that adding shipping and taxes will not take more than 40 lines of code...

 

If you're so cool, lets take a look at YOUR CODE - I can BET I fit in 40 lines by adding shipping and taxes to this contrib - will you fit in this 40 lines? Common, let us see what you can do! This will be the Google Checkout v 1.5 - with shipping and taxes! I only assume those 40 lines will not be more than 255 chars :):):)

 

So, pleople, let us wait for his code? How do you think?

 

About those 2-3 months - I'm planning to include everything Google API allows, including order processing and notification techniques. I'm also planning to redo an API a little so tose guys who does not have curl installed could use curl from comman line. The same with DOM XML library, which is currently for php < 5. And most of new hosting companies have php > 5 - so why does not allow to use Google checkout for them?

Share this post


Link to post
Share on other sites

kenfeyl,

 

Would love to see your "hack." Sounds like great work.

 

I hacked up abbat's code to compute the cheapest shipping method and pass it on to Google as a default-flat-rate.

 

Are you grabbing real rates from e.g. UPS?

. I then configured Checkout's Callback URL to point to a script that collects order and customer information from Google and sticks it into OSc's order and customer tables.

 

Does this capture all the attributes? Like size or color.

 

Again, please post your work somewhere. A lot of us would really appreciate it.

Share this post


Link to post
Share on other sites
kenfeyl,

 

Would love to see your "hack." Sounds like great work.

Are you grabbing real rates from e.g. UPS?

Does this capture all the attributes? Like size or color.

 

Again, please post your work somewhere. A lot of us would really appreciate it.

 

Essentially, I copied pieces from the various checkout_*.php steps, so that the "View Cart" page displays all the data on the order summary on checkout_payment.php, albeit with the ability to add and subtract items from the cart. So yes, this total includes all attributes and shipping. Although it does not display tax in this summary (because it doesn't know where you live), in the background it loads your tax zones and rates and keeps them in the XML sent to Google if the user checks out. The tax part works only for U.S. states.

 

My current version calls out to $shipping->cheapest() to get the cheapest of all the shipping modules you've enabled (this is the method labelled "Best Way" in the standard osCommerce checkout_shipping.php). That is just my personal hack because I have two shipping modules from which the user will always prefer the cheaper.

 

One thing I would like to do before packaging up this module is to add an Ajax shipping selection on the "View Cart" page, so that your user is allowed to select a shipping method before proceeding to Google, rather than just choosing the cheapest. This part will probably take me another few days as I know zero Ajax at the moment and Ajax is necessary since the XML will have to be repopulated after the shipping choice.

 

The final step is the order and customer processing. Behind the scenes it adds rows to customers and orders once Google calls home via the callback API.

 

If you want to get an idea of what's happening, and I'm embarassed to give out the link because you'll see that my site looks stock to the point of absurdity (my gf is working on a new template), check out http://www.officialclassicgames.com. Add an item to your cart, and then click on either "View Cart" or "Checkout." If you proceed to Google, you need to log in to your Google account before it actually populates the shipping and tax costs. But rest assured those came straight from my shipping modules and tax zones.

 

The only real disconnect of my hack to the osCommerce world is that I'm short-circuiting the concept of registered customers. My customers no longer log in -- they simply fill up their cart and then proceed to Google. Tell me what you guys think. I know it's a bit radical to eliminate logins -- what do you guys think? Also, my hacks do make Google the only means of payment.

Share this post


Link to post
Share on other sites

kenfeyl,

 

That mod looks very well done. I almost ordered a Backgammon set by accident. :) But does your mod really make Google Checkout the only form of payment available?

Share this post


Link to post
Share on other sites

Whoever is actively working on this mod, please contact me via PM or email... I can code the Google stuff, but I have no clue how osCommerce is setup. I really don't want to have to learn the osCommerce system just for this plugin, but I was hired to do the Google integration, then found out that the site was in osCommerce.

 

Help me figure out what osCommerce-specific commands to use and which of the thousands of files it goes into and I can whip out a Google solution that doesn't rely on their libxml (PHP4 only) code or some of the other unnecessary (and largely incompatible) Google example code.

 

If you know where the osCommerce equivalent is located, I can cover the Google end of the code.

Share this post


Link to post
Share on other sites
Yeah, I agree with you mijman2.

 

This guy doesn't really understand the concept of open source development.

 

You don't understand concept of shareware business. Also open source != free.

Try learning a little.

Share this post


Link to post
Share on other sites
After making the purchase... does the customer return to the oscommerce page. Is the order logged into osc and can this be used for automatic downloads?

 

 

The customer is not required to return to the OSC site. L2 Messages are passed while they're away that you can use to create an OSC order. I've got shipping working, order logging, risk notification and stock decrementing. Vouchers are a problem because the customer is not required to have an account so you can't count uses. Taxes should be easy but Google seem to have complicated things a lot. On final testing....

 

Graith dot co dot uk

Share this post


Link to post
Share on other sites

I've updated some of Alex's code from his contribution to handle a few errors (some not of his own) in the processing. I've also corrected a query for it to function properly with CRE Loaded. There are also some other debugging messages included for now for development purposes. Most of the fixes I made are captured in the comments within the GoogleCheckout.php file at the top.

 

http://stenod.derty.org/googlecheckout.php

Share this post


Link to post
Share on other sites
Any word on a Level 2 module?

Really looking foward to it :)

 

I wish I could code :(

 

I've finished Level 2 OSC and I'm looking for people to test it. I know CRE Loaded code as well as MS2. At the moment I've just got MS2 code but I'll be working on CRE Loaded as soon as I get a chance.

 

PM me if you're interested.

Share this post


Link to post
Share on other sites

graith,

Will your module work well with those selling automatic downloads? Meaning, as soon as a person pays with his Google payment, he can download his music.

 

I don't mind paying for something that fits my needs.


My Contribution

Music Download Store Template

http://www.oscommerce.com/community/contributions,4275

Share this post


Link to post
Share on other sites
graith,

Will your module work well with those selling automatic downloads? Meaning, as soon as a person pays with his Google payment, he can download his music.

 

I don't mind paying for something that fits my needs.

 

I don't see why not. I'd need access to a copy of your database and website to ensure I got it right though. I'll PM you my email address.

 

Google Checkout is a PayPal killer and may even be a good replacement for cc payment clearing facilities as the transaction charges might be lower (especially if you pay Google for Ads anyway), but we need to make it as usable as any other payment method. The only way to do that is with Level 2.

Share this post


Link to post
Share on other sites
I've finished Level 2 OSC and I'm looking for people to test it. I know CRE Loaded code as well as MS2. At the moment I've just got MS2 code but I'll be working on CRE Loaded as soon as I get a chance.

 

PM me if you're interested.

 

Thanks for all the offers to help testing. I've now got enough people testing it.

Share this post


Link to post
Share on other sites
Thanks for all the offers to help testing. I've now got enough people testing it.

Hi Brian

 

As you are in the UK, do you know when Google checkout will be available here & when will your code be available as a contribution. I understand you need to cover your costs first. :thumbsup:

 

Thanks

Julie

Share this post


Link to post
Share on other sites
Essentially, I copied pieces from the various checkout_*.php steps, so that the "View Cart" page displays all the data on the order summary on checkout_payment.php, albeit with the ability to add and subtract items from the cart. So yes, this total includes all attributes and shipping. Although it does not display tax in this summary (because it doesn't know where you live), in the background it loads your tax zones and rates and keeps them in the XML sent to Google if the user checks out. The tax part works only for U.S. states.

 

My current version calls out to $shipping->cheapest() to get the cheapest of all the shipping modules you've enabled (this is the method labelled "Best Way" in the standard osCommerce checkout_shipping.php). That is just my personal hack because I have two shipping modules from which the user will always prefer the cheaper.

 

One thing I would like to do before packaging up this module is to add an Ajax shipping selection on the "View Cart" page, so that your user is allowed to select a shipping method before proceeding to Google, rather than just choosing the cheapest. This part will probably take me another few days as I know zero Ajax at the moment and Ajax is necessary since the XML will have to be repopulated after the shipping choice.

 

The final step is the order and customer processing. Behind the scenes it adds rows to customers and orders once Google calls home via the callback API.

 

If you want to get an idea of what's happening, and I'm embarassed to give out the link because you'll see that my site looks stock to the point of absurdity (my gf is working on a new template), check out http://www.officialclassicgames.com. Add an item to your cart, and then click on either "View Cart" or "Checkout." If you proceed to Google, you need to log in to your Google account before it actually populates the shipping and tax costs. But rest assured those came straight from my shipping modules and tax zones.

 

The only real disconnect of my hack to the osCommerce world is that I'm short-circuiting the concept of registered customers. My customers no longer log in -- they simply fill up their cart and then proceed to Google. Tell me what you guys think. I know it's a bit radical to eliminate logins -- what do you guys think? Also, my hacks do make Google the only means of payment.

 

Your Google checkout is just what I need! Do you think you will have a contrib put together?


Life Is Too Short,

Enjoy Your Coffee!

Pete

Share this post


Link to post
Share on other sites
Hi Brian

 

As you are in the UK, do you know when Google checkout will be available here & when will your code be available as a contribution. I understand you need to cover your costs first. :thumbsup:

 

Thanks

Julie

 

 

I'm not privvy to inside Google knowledge, but I'd be surprised if Google hold Google Checkout back from UK/Germany for more than a few months.

 

I will put my own code level 2 code as a contribution when I've covered my development costs. I'd guess six months tops.

 

There some screenshots of OSC with Google Checkout on graith dot com

Share this post


Link to post
Share on other sites

perhaps I am missing something, last time I checked the gbuy files they were released under apache license v2.0.

 

And this from the www.gnu.org

Apache Software License, version 2.0

This is a free software license but it is incompatible with the GPL. The Apache Software License is incompatible with the GPL because it has a specific requirement that is not in the GPL: it has certain patent termination cases that the GPL does not require. (We don't think those patent termination cases are inherently a bad idea, but nonetheless they are incompatible with the GNU GPL.)

 

So how it will be integrated into a contribution with osc? unless google has a different set of files.

Share this post


Link to post
Share on other sites
perhaps I am missing something, last time I checked the gbuy files they were released under apache license v2.0.

 

And this from the www.gnu.org

So how it will be integrated into a contribution with osc? unless google has a different set of files.

 

The google checkout sample code are available free under the Apache license, but they don't integrate with OSCommerce. Google Checkout Level 1 and Level 2 is explained on Graith dot com. The integration with OSCommerce is what we're talking about.

Share this post


Link to post
Share on other sites

Brian, could you clarify that level2 can handle all the attributes associated with an order item and that it will be returned to the admin's order section. And that all attributes will be visible and recorded as all other orders in the oscommerce database.

 

And that google "calls" back to get our low shipping for that order based on the zip code. (this info will come from ups or fedex) or it may be free if the minimum is met.

 

I use the master produscts contrib. No problems, right?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×