Hi,
I'm trying to set up a sandbox environment to implement the google checkout, however it says run this code using telnet.
Command 1:
curl -d '<hello xmlns="http://checkout.google.com/schema/2"/>'
https://MERCHANT_ID:MERCHANT_KEY@sandbox.google.com/checkout/api/checkout/v2/request/Merchant/MERCHANT_ID
Command 2:
curl -d '<hello xmlns="http://checkout.google.com/schema/2"/>'
https://MERCHANT_ID:MERCHANT_KEY@checkout.google.com/api/checkout/v2/request/Merchant/MERCHANT_ID
taken from http://code.google.com/apis/checkout/developer/index.html
From what I can see my server does not have telnet so I tried to do it using the cURL functions built into php.
I was unsure how exactly cURL worked so I googled to find a sample script and managed to find one that fits the description perfectly.
<?php
define("MERCHANTID", "0000"); // taken out for security
define("MERCHANTKEY", "0000"); // taken out for security
// production URL
////$strURL = "https://checkout.google.com";
// dev URL
$strURL = "https://sandbox.google.com/checkout";
function GetAuthenticationHeaders(){
$headers = array();
$headers[] = "Content-Type: application/xml; charset=UTF-8";
$headers[] = "Accept: application/xml; charset=UTF-8";
return $headers;
}
// cURL ENGINE
$ch = curl_init(); // initialize a cURL session
curl_setopt ($ch, CURLOPT_URL, $strURL . "/api/checkout/v2/request/
Merchant/" . MERCHANTID );
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_HTTPHEADER, GetAuthenticationHeaders());
curl_setopt ($ch, CURLOPT_USERPWD, MERCHANTID . ':' . MERCHANTKEY);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$xyz = curl_exec ($ch);
echo "<pre>" . $xyz . "</pre>";
echo curl_error($ch);
curl_close ($ch);
?>
according to the integration guide if everything has worked I should get a response similar to this
<?xml version="1.0" encoding="UTF-8"?>
<bye xmlns="http://checkout.google.com/schema/2"
serial-number="c567262a-dd13-4084-b8d3-6ccfbbc69d03" />
however the output I get after loading the page is
SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Is this an issue with my host (i.e. I dont have a SSL cerificate), a problem with my code, or something I have over looked?
If any one has worked with the google checkout and could advise on this issue it would be much appreciated,
Thanks in advance,
Jon