Page 1 of 1

Google Checkout - Incorrect Callback?

Posted: Mon Apr 02, 2012 11:56 am
by showitoff
I have been getting errors that my callback url is wrong for my google checkout settings. This is the error that posted as of last night in the console:

We encountered an error trying to access your server at https://www.showitoffdecals.com/index.p ... t/callback -- the error we got is Send failed with code: 401. Response body was: Failed to Get Basic Authentication Headers

I am running Opencart 1.5.1.3, and just using the Google Checkout extension that's on this website. CANNOT get this thing to communicate properly.

Please help! I have searched the forums for answers pertaining to this exact problem, but the responses were either non-existent or not fully applicable to my own situation.

Thanks!

Re: Google Checkout - Incorrect Callback?

Posted: Sat Apr 07, 2012 1:38 am
by JNeuhoff
showitoff wrote:I have been getting errors that my callback url is wrong for my google checkout settings. This is the error that posted as of last night in the console:

We encountered an error trying to access your server at https://www.showitoffdecals.com/index.p ... t/callback -- the error we got is Send failed with code: 401. Response body was: Failed to Get Basic Authentication Headers

I am running Opencart 1.5.1.3, and just using the Google Checkout extension that's on this website. CANNOT get this thing to communicate properly.

Please help! I have searched the forums for answers pertaining to this exact problem, but the responses were either non-existent or not fully applicable to my own situation.

Thanks!
Any messages in your Google's Integration console?

Re: Google Checkout - Incorrect Callback?

Posted: Sat Apr 07, 2012 9:47 am
by showitoff
That is where I got this message:
We encountered an error trying to access your server at https://www.showitoffdecals.com/index.p ... t/callback -- the error we got is Send failed with code: 401. Response body was: Failed to Get Basic Authentication Headers

Re: Google Checkout - Incorrect Callback?

Posted: Sat Apr 07, 2012 5:49 pm
by JNeuhoff
Ask your webhost to re-configure your web server so it can support basic authentication. The Google library expects to find the standard $_SERVER['PHP_AUTH_USER'] and the $_SERVER['PHP_AUTH_PW'] for this.

If they can't re-configure it, change webhost, I recommend Hostgator.

Re: Google Checkout - Incorrect Callback?

Posted: Tue Apr 10, 2012 11:52 pm
by showitoff
Thank you so much for your help. I have contacted my host, and this is the response I received when I asked about making sure our server is set up for basic authentication:
The basic authentication module is installed on all servers. I see that google is contacting the index of your page, which you would normally NOT want to have an authentication barrier to, so I am assuming the plugin you're working with is supposed to intercept these calls and provoke basic authentication, but is not doing so for some reason (misconfiguration, etc.

Good luck,
Pete V
Can you help? I'm thinking now I just have my callback string wrong. How do I know what it's supposed to be?

Re: Google Checkout - Incorrect Callback?

Posted: Wed Apr 11, 2012 1:52 am
by JNeuhoff

Re: Google Checkout - Incorrect Callback?

Posted: Wed Apr 11, 2012 11:57 am
by showitoff
I copied and pasted the API you listed above into my opencart module settings AND my google checkout integration settings and it's still not working.

What else could I possibly be doing wrong?

Re: Google Checkout - Incorrect Callback?

Posted: Wed Apr 11, 2012 4:00 pm
by JNeuhoff
showitoff wrote:I copied and pasted the API you listed above into my opencart module settings AND my google checkout integration settings and it's still not working.

What else could I possibly be doing wrong?
I am unable to reproduce your error as it is working just fine on other webhosts.

To narrow it down, add this into the catalog/controller/checkout/gcheckout.php:

Code: Select all

	function callback() {
		// make sure its posted
		if (strtoupper($this->request->server['REQUEST_METHOD']) != 'POST') {
			$this->response->redirect($this->url->link('common/home'));
		}
		ob_start();
		var_dump( $_SERVER );
		$this->log->write( ob_get_contents() );
		ob_end_clean();
		.....
Then test it again, and let me know what your system/logs/error.txt gets, in particular, whether the $_SERVER has the expected $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] values.

Re: Google Checkout - Incorrect Callback?

Posted: Tue Aug 07, 2012 12:10 am
by Drummermoose
Hi, sorry to hackjack this thread - although it looks like its been dead for a few months.

I keep on getting 'Failed to Get Basic Authentication Headers'.

I've got SSL installed
auth_basic apache module selected
here's my error log:

Code: Select all

2012-08-06 15:42:45 - array(32) {
  ["PATH"]=>
  string(28) "/usr/local/bin:/usr/bin:/bin"
  ["REDIRECT_STATUS"]=>
  string(3) "200"
  ["PP_CUSTOM_PHP_INI"]=>
  string(48) "/var/www/vhosts/websiteaddress.co.uk/etc/php.ini"
  ["HTTPS"]=>
  string(2) "on"
  ["CONTENT_TYPE"]=>
  string(30) "application/xml; charset=UTF-8"
  ["HTTP_USER_AGENT"]=>
  string(38) "Google Checkout Notification Agent 1.0"
  ["HTTP_HOST"]=>
  string(24) "www.websiteaddress.co.uk"
  ["CONTENT_LENGTH"]=>
  string(4) "5655"
  ["HTTP_ACCEPT_ENCODING"]=>
  string(4) "gzip"
  ["SERVER_SOFTWARE"]=>
  string(6) "Apache"
  ["SERVER_NAME"]=>
  string(24) "www.websiteaddress.co.uk"
  ["SERVER_ADDR"]=>
  string(12) "91.102.69.91"
  ["SERVER_PORT"]=>
  string(3) "443"
  ["REMOTE_ADDR"]=>
  string(13) "74.125.186.46"
  ["DOCUMENT_ROOT"]=>
  string(45) "/var/www/vhosts/websiteaddress.co.uk/httpdocs"
  ["SERVER_ADMIN"]=>
  string(23) "admin@websiteaddress.co.uk"
  ["SCRIPT_FILENAME"]=>
  string(55) "/var/www/vhosts/websiteaddress.co.uk/httpdocs/index.php"
  ["REMOTE_PORT"]=>
  string(5) "46712"
  ["REDIRECT_QUERY_STRING"]=>
  string(33) "route=checkout/gcheckout/callback"
  ["REDIRECT_URL"]=>
  string(10) "/index.php"
  ["GATEWAY_INTERFACE"]=>
  string(7) "CGI/1.1"
  ["SERVER_PROTOCOL"]=>
  string(8) "HTTP/1.1"
  ["REQUEST_METHOD"]=>
  string(4) "POST"
  ["QUERY_STRING"]=>
  string(33) "route=checkout/gcheckout/callback"
  ["REQUEST_URI"]=>
  string(44) "/index.php?route=checkout/gcheckout/callback"
  ["SCRIPT_NAME"]=>
  string(10) "/index.php"
  ["ORIG_SCRIPT_FILENAME"]=>
  string(40) "/var/www/cgi-bin/cgi_wrapper/cgi_wrapper"
  ["ORIG_PATH_INFO"]=>
  string(10) "/index.php"
  ["ORIG_PATH_TRANSLATED"]=>
  string(55) "/var/www/vhosts/websiteaddress.co.uk/httpdocs/index.php"
  ["ORIG_SCRIPT_NAME"]=>
  string(20) "/phppath/cgi_wrapper"
  ["PHP_SELF"]=>
  string(10) "/index.php"
  ["REQUEST_TIME"]=>
  string(10) "1344267765"
}
Any ideas?

Thanks,

Re: Google Checkout - Incorrect Callback?

Posted: Tue Aug 07, 2012 2:23 am
by JNeuhoff
Looks like your server doesn't provide the expected $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] values.

Get in touch with your web host, or switch web host.

Re: Google Checkout - Incorrect Callback?

Posted: Tue Aug 07, 2012 6:19 pm
by Drummermoose
I've spoken to my host but they can't help.

Here's the list of apache modules..which ones do I need to activate?

Image

thanks

Re: Google Checkout - Incorrect Callback?

Posted: Tue Aug 07, 2012 7:21 pm
by JNeuhoff
It is the auth_basic Apache module.

HTTP authentication does not work with the cgi version of PHP, so if your hosting allows you will need to switch to PHP as Apache module or look for an alternative solution.

Re: Google Checkout - Incorrect Callback?

Posted: Tue Aug 07, 2012 9:48 pm
by Drummermoose
Thanks for your response.

I was just going through the installation procedure to check if everything was ok when I saw the version I installed is 1.5.1.2 and my opencart version is 1.5.2.1.

I think maybe this is the problem