Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 2
Google Checkout Carrier Calculated Shipping is always displaying default shipping amount
 
etho201
Sr. Member
 
Total Posts:  85
Joined:  2008-04-03
Summerville, SC
 

I have made several posts about this issue.. never received any replies… I am glad to see someone is working on this! smile I tried your fix but I didn’t get any results. I think maybe my problem is with the api callback. I guess I don’t understand how to get that working. I always get the same error every time in the integration console.

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

Does anyone know what I am doing wrong?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jbeall
Member
 
Total Posts:  33
Joined:  2008-02-18
West Virginia
 
etho201 - 07 May 2008 07:35 PM


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

Does anyone know what I am doing wrong?

This indicates that the webserver is denying access to Google when Google Checkout attempts to send a message back to your server.  You need to check your authentication settings.  The easiest thing to do would be to turn off Basic Authentication entirely, to verify that you have indeed isolated the problem.

I’m not familiar with Google Checkout’s callback API—is it a security vulnerability to leave open to the public, as far as Apache is concerned?  My basic understanding is that the messages themselves must include authentication information, so it would be ok to let any message through.  The callback API itself should authenticate any inbound messages.

-Josh

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

Thanks for the quick reply Jbeall… You have given me a better understanding of the issue. Maybe I don’t know how to disable the authentication… I tried to comment out any type of authentication in the .htaccess file but didn’t get any results.. it looks like I am able to disable the check for the merchant id and key in the googleresponse.php file… but I don’t know what to comment out/delete without messing the whole thing up. I know this sounds like a completely different issue than the topic of this discussion but I feel that it is the root to my problem with the carrier calculated shipping.

 
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
 

After removing the authentication, the carrier calculated shipping worked me if I was logged in… and then I tried a different address and it went back to the default. When I tried Jbeal’s fix, everything seems to be fixed.

Thanks! smile

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

Hopefully this bug will be the subject of the Magento team soon, and we’ll get a fix that doesn’t involve any hacks.

-Josh

 
Magento Community Magento Community
Magento Community
Magento Community
 
lisali
Enthusiast
 
Avatar
Total Posts:  889
Joined:  2008-04-28
London, UK
 

Hi -

I have tried jbeall’s hack - it still does not work for me with table rates. Google Checkout still displays NO shipping, it just does not seem to be receiving that information from Magento. It still keeps saying “Your server returned no data in its reply; Checkout requires data of type merchant-calculation-results in reply to merchant-calculation-callback”.

I am pulling my hair out at this stage, as I do not know what else to try.

:(

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 2