Magento Forum

   
Poll
Is your Google Checkout Carrier Calculated shipping working for you?
Yes 6
No 14
Have not tried it yet. 13
Total Votes: 33
You must be a logged-in member to vote
Does Google Checkout work? [semi-solved]
 
etho201
Sr. Member
 
Total Posts:  85
Joined:  2008-04-03
Summerville, SC
 

Is Google checkout working completely? I have tried to get the Carrier calculated shipping to work but I have had no success. Any ideas?

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
etho201
Sr. Member
 
Total Posts:  85
Joined:  2008-04-03
Summerville, SC
 

Ok, I looked at Google Checkout tools and in the Integration Issue Detail it said:

We encountered an error trying to access your server at https://secure.yourdomain.com/googlecheckout/api/—the error we got is: Sending failed with HTTP response code: 401. Response body was: Failed to Get Basic Authentication Headers

Anyone know why I would be getting the 401? Anyone know of a fix?

Thanks in advance!

 
Magento Community Magento Community
Magento Community
Magento Community
 
etho201
Sr. Member
 
Total Posts:  85
Joined:  2008-04-03
Summerville, SC
 

Then it says, “XML We Sent:” with the following code:

<?xml version="1.0" encoding="UTF-8"?>
<merchant-calculation-callback xmlns="http://checkout.google.com/schema/2" serial-number="f684380d-r2d2-456d-a8b1-f3ad3f2bb5b1">
  <
shopping-cart>
    <
items>
      <
item>
        <
item-weight value="2.0" unit="LB" />
        <
tax-table-selector>2</tax-table-selector>
        <
item-name>Sample Product B</item-name>
        <
item-description></item-description>
        <
quantity>1</quantity>
        <
unit-price currency="USD">29.95</unit-price>
        <
merchant-item-id>10123-Blue-Medium</merchant-item-id>
        <
merchant-private-item-data>
          
                
          <
quote-item-id>299</quote-item-id>
          
            
        </
merchant-private-item-data>
      </
item>
    </
items>
    <
merchant-private-data>
      
                
      <
quote-id>69</quote-id>
      
            
    </
merchant-private-data>
  </
shopping-cart>
  <
buyer-id>371336154727225</buyer-id>
  <
calculate>
    <
addresses>
      <
anonymous-address id="361827037938980">
        <
country-code>US</country-code>
        <
city>Charleston</city>
        <
region>SC</region>
        <
postal-code>29404</postal-code>
      </
anonymous-address>
    </
addresses>
    <
shipping />
    <
tax>true</tax>
    <
merchant-code-strings />
  </
calculate>
  <
buyer-language>en_US</buyer-language>
</
merchant-calculation-callback>

 
Magento Community Magento Community
Magento Community
Magento Community
 
jbeall
Member
 
Total Posts:  33
Joined:  2008-02-18
West Virginia
 

Did you get this resolved, eth?

Also, I responded to another thread of yours on this topic.
http://www.magentocommerce.com/boards/viewthread/6552/

 
Magento Community Magento Community
Magento Community
Magento Community
 
etho201
Sr. Member
 
Total Posts:  85
Joined:  2008-04-03
Summerville, SC
 

Still no luck over here… I don’t know if it is a Google Checkout problem or a Magento problem… I am going to try posting on the Google forums to see what they have to say. I was hoping this would be fixed with 1.0.19700 but all of the bugs I have been experiencing still haven’t been fixed… So I’ll see what I can do in the meantime.

 
Magento Community Magento Community
Magento Community
Magento Community
 
etho201
Sr. Member
 
Total Posts:  85
Joined:  2008-04-03
Summerville, SC
 

I see that someone voted that it does work… any suggestions on how to get this or did it just work automatically with no additional configuration? I’m still lost with this.

 
Magento Community Magento Community
Magento Community
Magento Community
 
etho201
Sr. Member
 
Total Posts:  85
Joined:  2008-04-03
Summerville, SC
 

I finally got this to work!!! I don’t know how serious a security threat this presents, but here is what I did.

Open:
/public_html/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Callback.php

Delete lines 47 - 51:

$status $this->getGResponse()->HttpAuthentication();

        if (!
$status || empty($data[$root])) {
            
exit;
        
}

Open:
/public_html/lib/googlecheckout/googleresponse.php

Delete lines 73 - 119:

/**
     * Verifies that the authentication sent by Google Checkout matches the
     * merchant id and key
     *
     * @param string $headers the headers from the request
     */
    function HttpAuthentication($headers=null$die=true{
      
if(!is_null($headers)) {
        $_SERVER 
$headers;
      
}
      
// moshe's fix for CGI
      
if (empty($_SERVER['HTTP_AUTHORIZATION'])) {
          
foreach ($_SERVER as $k=>$v{
              
if (substr($k, -18)==='HTTP_AUTHORIZATION' && !empty($v)) {
                  $_SERVER[
'HTTP_AUTHORIZATION'$v;
                  break;
              
}
          }
      }

      
if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
        $compare_mer_id 
$_SERVER['PHP_AUTH_USER'];
        
$compare_mer_key $_SERVER['PHP_AUTH_PW'];
      
}

  
//  IIS Note::  For HTTP Authentication to work with IIS,
  // the PHP directive cgi.rfc2616_headers must be set to 0 (the default value).
      
else if(isset($_SERVER['HTTP_AUTHORIZATION'])){
        
list($compare_mer_id$compare_mer_key) = explode(':',
            
base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'],
            
strpos($_SERVER['HTTP_AUTHORIZATION']" ") + 1)));
      
else if(isset($_SERVER['Authorization'])) {
        
list($compare_mer_id$compare_mer_key) = explode(':',
            
base64_decode(substr($_SERVER['Authorization'],
            
strpos($_SERVER['Authorization']" ") + 1)));
      
else {
        $this
->SendFailAuthenticationStatus(
              
"Failed to Get Basic Authentication Headers",$die);
        return 
false;
      
}
      
if($compare_mer_id != $this->merchant_id
         
|| $compare_mer_key != $this->merchant_key{
        $this
->SendFailAuthenticationStatus("Invalid Merchant Id/Key Pair",$die);
        return 
false;
      
}
      
return true;
    
}

 
Magento Community Magento Community
Magento Community
Magento Community
 
etho201
Sr. Member
 
Total Posts:  85
Joined:  2008-04-03
Summerville, SC
 

[moved to another thread]

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