Magento Forum

   
Google Checkout - Carrier Calculated shipping problem [semi-solved]
 
gabka
Jr. Member
 
Total Posts:  3
Joined:  2008-10-29
 

Hi,

I had shipping the price 0 problem with merchant calculations too.
I have downloaded and replaced callback.php and googlemerchantcalculations.php provided by Serge in this thread and it almost solved the problem, but not in every case.

After many attempts to solve this, I’ve decided to look in googlecheckout_api_debug table, and in callback.php.
I realized that google sends 5 shipping method price request to magento and magento only replies for those which are available to specified address in the responsexml, BUT google needs the rest of shipping methods with available=false value. Not receiving these casues Google Checkout to time out and display 0 or whatever is set as the default shipping cost.

So I opened callback.php which is located at magento_root/app/code/core/Mage/Googlecheckout/Model/Api/Xml/ and made some extra modifications. I’ve marked the new or modified lines with “//g_mod” after them.
To make sure, clear all cache before testing it.

I hope this helps anybody.

Best Regards,
Gabka

File Attachments
Callback.php  (File Size: 23KB - Downloads: 205)
 
Magento Community Magento Community
Magento Community
Magento Community
 
johnh123
Member
 
Total Posts:  64
Joined:  2008-06-12
 

So does this fix the problem by itself, or do you need to change googlemerchantcalculations.php as well?

 
Magento Community Magento Community
Magento Community
Magento Community
 
gabka
Jr. Member
 
Total Posts:  3
Joined:  2008-10-29
 

To be honest, I did not tested it with the old googlemerchantcalculations.php smile The best would be to replace that too.

 
Magento Community Magento Community
Magento Community
Magento Community
 
JustinS
Jr. Member
 
Total Posts:  1
Joined:  2009-03-13
 

If Serge or Lisa or anyone who has successfully integrated Google Checkout with USPS and UPS with accurate rates are still around, I’d love some help!  After reading though every entry, and trying everything, I have gotten it to the point where it actually pulls SOMETHING, but it is inaccurate.

Just so you know, I have gone through all previous nine pages of this thread.  SSL is good to go, still requires site.com/index.php/gc/api, but it is communicating.  Not getting errors in the Integration Console.  It’s at Bluehost, so it is on PHP as CGI, but I went through all the steps that I understand as necessary to make that work.

Here are some numbers that are interesting to me, it seems to me that UPS and USPS may have different issues.  First number is the number Magento pulls in the “estimate”, second number is what shows in Google Checkout.

$1.95 handling fee should be applied…

USPS
Priority Mail - $35.80 (-18%)($6.35 difference)
Express Mail - $74.30 (-10%) ($7.35 difference)

UPS
Ground - $22.35 (-35%) ($7.69 difference)
3 Day Select - $47.00 (-25%) ($11.48 difference)
2nd Day Air - $72.88 (-23%) ($16.19 difference)
Next Day Air - $114.55 (-14%) ($15.68 difference)

Does anyone have any thoughts on how to reconcile this?  I have tried everything I know to try.  It’s the latest version of Magento, if that helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ASchroder
Member
 
Avatar
Total Posts:  49
Joined:  2008-10-09
New Zealand
 

The problem with Google Checkout shipping methods missing which is characterized by this error in your Google Checkout integration console:

“We were looking for data in your merchant-calculation-results, but were not able to find it: result: address-id: XXX”

and the bug with the determination of free shipping eligibility when calculated by Google checkout are still in Magento 1.2.1.

I documented solutions to both problems on my blog for version 1.1.7 of Magento. The solution to the first problem, the missing data in your merchant calculation, and the second problem the free shipping method not being applicable to an order in Google Checkout even when it should. I have also since written a simple set of 3 steps to take when debugging Google Checkout problems.

Hope that helps those with the same problems as I had (and continue to have).

 
Magento Community Magento Community
Magento Community
Magento Community
 
got-bonsai
Sr. Member
 
Avatar
Total Posts:  136
Joined:  2008-10-25
Wales, UK
 

@ gabka
Thanks for the solution - it works perfectly.  First time I’ve ever seen the correct postage amounts passed to google checkout.  Thanks again.

NB: I didn’t change googlemerchantcalculations.php.  All I changed was the more recent callback.php from 1.3.1 (It was a lot different to the one that gabka edited).  I’ve attached it with gabka’s “//g_mod” comments after the added lines (4 lines, 234-237).

NB: Make sure you add every possible shipping method to the Google Checkout Delivery - Merchant Calculated settings.

File Attachments
Callback.php  (File Size: 29KB - Downloads: 182)
 
Magento Community Magento Community
Magento Community
Magento Community
 
mbokon
Jr. Member
 
Total Posts:  8
Joined:  2009-01-23
 

I also am getting 0 shipping with either merchant calulated or carrier calculated methods. I replace the Callback.php file with the one from got-bonsai, but still get 0 shipping. There are no errors in the googlecheckout_api_debug table and you can see the shipping prices are being passed for all the shipping types setup in Magento. All the other Google Checkout functions (except shipping values) are working fine, orders in Magento are correctly updated when processing an order in the Sandbox.

I will get post data from the googlecheckout_api_debug table and post it here later.

I appreciate any help any one can give. I am expecting to go online with this store next week but this is holding everything up.

Thanks,

mbokon
Rochester NY

 
Magento Community Magento Community
Magento Community
Magento Community
 
mbokon
Jr. Member
 
Total Posts:  8
Joined:  2009-01-23
 

Below is information from the googlecheckout_api_debug table for a Google merchant request and the resulting Magento callback. It appears Magento is sending the data and in the correct format but noticed the response from Magento does not appear to be in UTF-8 format like the request is from Google? Could this be causing problems? The original request from Magento also does not appear to be in UTF-8 and Google has no problem with it.

Request from Google:

<?xml version="1.0" encoding="UTF-8"?>

<merchant-calculation-callback xmlns="http://checkout.google.com/schema/2" serial-number="a02c3b0b-4cb1-4de2-814f-25610aed2cfb">

<shopping-cart>

<items>

<item>

<item-weight value="7.0" unit="LB" />

<tax-table-selector>2</tax-table-selector>

<item-name>SLR Camera Tripod</item-name>

<item-description></item-description>

<quantity>1</quantity>

<unit-price currency="USD">99.0</unit-price>

<merchant-item-id>ac674</merchant-item-id>

<merchant-private-item-data>

<quote-item-id>61</quote-item-id>

</merchant-private-item-data>

</item>

<item>

<item-weight value="7.0" unit="LB" />

<tax-table-selector>2</tax-table-selector>

<item-name>SLR Camera Tripod</item-name>

<item-description></item-description>

<quantity>1</quantity>

<unit-price currency="USD">99.0</unit-price>

<merchant-item-id>ac674</merchant-item-id>

<merchant-private-item-data>

<quote-item-id>62</quote-item-id>

</merchant-private-item-data>

</item>

</items>

<merchant-private-data>

<quote-id><![CDATA[50]]></quote-id>

</merchant-private-data>

</shopping-cart>

<buyer-id>602230174614677</buyer-id>

<calculate>

<addresses>

<anonymous-address id="316631036022558">

<country-code>US</country-code>

<postal-code>92346</postal-code>

<city>Highland</city>

<region>CA</region>

</anonymous-address>

</addresses>

<shipping>

<method name="United Parcel Service - Ground” />

<method name="United Parcel Service - 2nd Day Air” />

<method name="United Parcel Service - Next Day Air” />

<method name="United Parcel Service - 3 Day Select” />

<method name="United Parcel Service - Next Day Air Saver” />

</shipping>

<tax>true</tax>

<merchant-code-strings />

</calculate>

<buyer-language>English</buyer-language>

</merchant-calculation-callback>

Resonse from Magento sent back to Google

<?xml version="1.0" encoding="utf-8"?>
<merchant-calculation-results xmlns="http://checkout.google.com/schema/2">
<results>
<result shipping-name="United Parcel Service - Ground” address-id="316631036022558">
<shipping-rate currency="USD">19.51</shipping-rate>
<shippable>true</shippable>
<total-tax currency="USD">0</total-tax>
</result>
<result shipping-name="United Parcel Service - 2nd Day Air” address-id="316631036022558">
<shipping-rate currency="USD">66.2</shipping-rate>
<shippable>true</shippable>
<total-tax currency="USD">0</total-tax>
</result>
<result shipping-name="United Parcel Service - Next Day Air” address-id="316631036022558">
<shipping-rate currency="USD">104.5</shipping-rate>
<shippable>true</shippable>
<total-tax currency="USD">0</total-tax>
</result>
<result shipping-name="United Parcel Service - 3 Day Select” address-id="316631036022558">
<shipping-rate currency="USD">40.95</shipping-rate>
<shippable>true</shippable>
<total-tax currency="USD">0</total-tax>
</result>
<result shipping-name="United Parcel Service - Next Day Air Saver” address-id="316631036022558">
<shipping-rate currency="USD">94.5</shipping-rate>
<shippable>true</shippable>
<total-tax currency="USD">0</total-tax>
</result>
</results>
</merchant-calculation-results>

 
Magento Community Magento Community
Magento Community
Magento Community
 
mbokon
Jr. Member
 
Total Posts:  8
Joined:  2009-01-23
 

Attached the file I pasted from above. It has formating and is a little easier to read.

Thanks,

Mark
Rochester NY

File Attachments
Google merchant-calculation-callback.xml  (File Size: 4KB - Downloads: 125)
 
Magento Community Magento Community
Magento Community
Magento Community
 
mbokon
Jr. Member
 
Total Posts:  8
Joined:  2009-01-23
 

I finally found out why I am getting 0 shipping in Google Checkout.

My system seems to take longer than 3 seconds (5 to 8 seconds to get a shipping quote on the frontend) to respond to Google and Google times out after 3 seconds waiting for a response from the call back request according to there API. All the messages in my Google Checkout integrations (and there is one for each test I made) console reads:
“We timed out waiting for your server at https://www.xyz.com/googlecheckout/api/—the error we got is: Read timed out. Your server must respond faster to merchant calculation callback requests. “

Even if my was server was responding within Google’s 3 second timeframe, there is no guarantee that when traffic load is high (your host service is under a heavy load for instance) or UPS or FedEx is slow taking them a few extra seconds getting back to Magento with the rates, that it will work. To me, it seems more likely to failover to the default shipping values than to reliably work except under ideal conditions. Sorry, but to me this is just a lame way to setup a system that could a business to lose considerable money.

I am going to see if I can get the carrier calculated rates to work but If they need a response back from my server then I am going to abandon using Google Checkout.

I hope this sheds additional light on using Google Checkout.

mbokon

 
Magento Community Magento Community
Magento Community
Magento Community
 
dniesen
Member
 
Total Posts:  74
Joined:  2008-04-05
 

I’ve run into this as well.  Is anybody using Google Checkout with calculated shipping successfully?

The low timeout setting seems ridiculous.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sdecombiz
Jr. Member
 
Avatar
Total Posts:  5
Joined:  2009-03-05
San Diego
 
gabka - 09 March 2009 08:28 AM

Hi,

I had shipping the price 0 problem with merchant calculations too.
I have downloaded and replaced callback.php and googlemerchantcalculations.php provided by Serge in this thread and it almost solved the problem, but not in every case.

After many attempts to solve this, I’ve decided to look in googlecheckout_api_debug table, and in callback.php.
I realized that google sends 5 shipping method price request to magento and magento only replies for those which are available to specified address in the responsexml, BUT google needs the rest of shipping methods with available=false value. Not receiving these casues Google Checkout to time out and display 0 or whatever is set as the default shipping cost.

So I opened callback.php which is located at magento_root/app/code/core/Mage/Googlecheckout/Model/Api/Xml/ and made some extra modifications. I’ve marked the new or modified lines with “//g_mod” after them.
To make sure, clear all cache before testing it.

I hope this helps anybody.

Best Regards,
Gabka

If you could help me with my problem I would really appreciate it.  Please check your PMs.

-SD

 
Magento Community Magento Community
Magento Community
Magento Community
 
sdecombiz
Jr. Member
 
Avatar
Total Posts:  5
Joined:  2009-03-05
San Diego
 
gabka - 09 March 2009 08:40 AM

To be honest, I did not tested it with the old googlemerchantcalculations.php smile The best would be to replace that too.

Where can I get the new googlemerchantcalculations.php ??

-SD

 
Magento Community Magento Community
Magento Community
Magento Community
 
ForgetHangovers
Sr. Member
 
Total Posts:  83
Joined:  2009-04-12
Maryland, USA
 

I have the same problem “Send failed with code: 401. Response body was: Failed to Get Basic Authentication Headers” & shipping isn’t calculated properly ($0.00 for each option).
Anyone have a valid solution?

I am using SSL on a sharedhost (DreamHost).

 
Magento Community Magento Community
Magento Community
Magento Community
 
ForgetHangovers
Sr. Member
 
Total Posts:  83
Joined:  2009-04-12
Maryland, USA
 

Supposedly Fixed in v1.3.2: http://www.magentocommerce.com/bug-tracking/issue?issue=6083
However, I just upgraded and I am still experiencing the same problem (All shipping options show $0.00) :(

This seems to be a more valid Bug Report: http://www.magentocommerce.com/bug-tracking/issue/?issue=5434
Reported on 3/1/09, still no fix :(

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top