1

I'm trying to add Google Checkout to my magento 1.7.0.0 shop. I've traced the issue and it seems to fail during posting to google's server because when I try to read the response it's false.

The error I get is: Google Checkout: Invalid response from Google Checkout server

I'm using magento 1.7, google sandbox with sandbox credentials, verified bank account, unchecked digitally signed carts, but am using a self-signed certificate on my development machine, and API version 2.2.

The issue is happening in app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Abstract.php on lines 174, 175

$http = new Varien_Http_Adapter_Curl();
$http->write('POST', $url, '1.1', $headers, $xml);
$response = $http->read();
Nate
  • 578
  • 2
  • 8
  • Tried turning SSL off on frontend and still have the same issue. Deleted cache/session for good measure. – Nate Aug 27 '12 at 19:44

2 Answers2

0

Not a PHP dev ~

Is this a sandbox server to server (Shopping Cart) POST? Check:

Note - unchecking "digital cart" only means your account will also accept HTML API cart POSTs, but it doesn't mean you can send XML without a digital signature if doing direct FORM post to Google - re: in XML API, you have 2 options to send XML data:

  1. Direct HTML FORM POST to Google (must include signature), or;
  2. Server to Server POST to Google (must use Basic Auth credentials)

You can also check your sandbox Integration Console for detailed error messages:

Tools -> Integration Console

Hth...

EdSF
  • 11,753
  • 6
  • 42
  • 83
  • I'm doing a server to server post. I'm using sandbox credentials and posting to the sandbox url. Will it matter if my ssl certificate is self signed? – Nate Aug 28 '12 at 13:03
  • @Nate - In *sandbox*, SSL isn't needed....anything in your `Integration Console`? If there's nothing in the IG, from personal experience its almost always an issue of using Production Merchant ID/Key in sandbox (they're **not** interchangeable). What url are you `POST`ing to (and what xml are you posting)? – EdSF Aug 28 '12 at 17:56
  • There's nothing in my integration console, but I'm definitely using the right credentials. I have this error 'You must use HTTP Basic Authentication for API calls (username=Seller ID, password=Merchant Key)' form the 23, but I've tried to check out since then. – Nate Aug 30 '12 at 15:29
  • @Nate `You must use HTTP Basic Authentication for API calls` is likely the issue. As above, your HTTP request headers must include Basic Authentication credentials (*sandbox* mid/key in your case) - [as described here](https://developers.google.com/checkout/developer/Google_Checkout_XML_API#https_auth_scheme) (same as above). – EdSF Aug 30 '12 at 16:57
  • Yep, this is how it's being sent: $http->write('POST', $url, '1.1', $headers, $xml); – Nate Aug 30 '12 at 17:41
0

There was a problem with it being a local environment. The issue was either with Google not being able to communicate or with my tld ending in .dev. Possibly Google rejected the request for that reason.

Nate
  • 578
  • 2
  • 8