did a brand new 1.1.2 install, and applied the URL file...I’m still getting: “We encountered an error trying to access your server at https://www.website.com/googlecheckout/api/—the error we got is: Sending failed with HTTP response code: 401. Response body was: Failed to Get Basic Authentication Headers “
Warnings:
My fix is to make sure an SSL Callback URL gets sent to Google. Sounds like the last 2 posts are HTTP Auth related. I’m guessing having read the rest of this thread - that it might be PHP/CGI related.
FYI. My bug fix introduced a new bug. HTTPS URLs were not getting set in the Admin panel + perhaps elsewhere. Sorry, Only been using Magento for a week or 2. => I’ve updated the getBaseUrl() Method in my original post.
so i’ve run into the 0.00 shipping problem with Google Checkout. i’ve tried following what Serge & Mike were talking about earlier in this thread, but now when i click the GoogleCheckout button, it hangs up for a while and then takes me to a secure page that says my shopping cart is empty. from there, i can click on “My Cart” which takes me to an unsecure page that displays the cart contents and has the following error message:
Google Checkout: Error parsing XML; message from parser is: cvc-datatype-valid.1.2.1: ‘[https://SECURESITEURL/googlecheckout/api’ is not a valid value for ‘anyURI’.
can anyone point out to me where i might be going wrong?
thanks in advance for any help.
well now i have gone back and replaced all the mod-ed files with the original ones to start over.
is there a quick rundown/summary/step-by-step guide of how to get rid of the $0.00 shipping problem?
i feel there are too many issues being addressed in this thread and using all the different bits and pieces might be causing things to not function properly.
/** * 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; } } }
// 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; }
Then the obvious… [configure] Magento Admin > System > Configuration > Google API > Google Checkout
Also, go to checkout.google.com > Settings > Integration >
API callback URL: https://SECURE_SITEURL/googlecheckout/api
Jbeal’s fix doesn’t seem to be required for the latest version of Magento.
Then the obvious… [configure] Magento Admin > System > Configuration > Google API > Google Checkout
Also, go to checkout.google.com > Settings > Integration >
API callback URL: https://SECURE_SITEURL/googlecheckout/api
You no longer need to modify “googleresponse.php”
Jbeal’s fix doesn’t seem to be required for the latest version of Magento.
Yes, it does pose a slight security risk because it removes the HTTP basic authentication.
HTTP Basic Authentication is a scheme designed to allow a client program to provide credentials in the form of a user name and password when requesting a HTTP transaction. However, these credentials are passed over the network as clear text. Therefore, Basic Authentication isn’t considered to be a secure method of user authentication unless accompanied by an external secure system such as SSL or TLS.
So, in theory… if someone were to figure out you removed basic authentication then they could find a way to trick it and make your Magento store think that they paid when they really did not. As long as you confirm that you received the payment by logging into google checkout and looking at the orders/payouts tab you won’t have any problems. If your site is rather busy, and you process lots of sales everyday, this could become tedious. It might also be wise to make sure they payed the correct amount in Google Checkout. I believe that it is very unlikely that this will ever happen though.
Hope that gives you a better understanding… other than that, I’m glad it’s working for you!
Then the obvious… [configure] Magento Admin > System > Configuration > Google API > Google Checkout
Also, go to checkout.google.com > Settings > Integration >
API callback URL: https://SECURE_SITEURL/googlecheckout/api
You no longer need to modify “googleresponse.php”
Jbeal’s fix doesn’t seem to be required for the latest version of Magento.
Everything works!
I’m running 1.1.3 and tried this “hack” and it’s still not working. I don’t have SSL or anything, but I was thinking it should work, regardless.
Any support on this issue would be sweet.
I got Google checkout for sandbox to recognize shipping after I enabling the “Allowed Methods” options in the Configuration > Google API > Google Checkout Shipping - Merchant Calculated. When I tried testing without creating the “Allowed Methods” options I got similar errors to everyone else. After I matched the settings to the shipping methods allowed in the other section, shipping charges seemed to work.