This is the common problem where i seen in all the forums but they cant get correct answers and some of them cannot understand answers, so let me explain very clearly. First as we go just make sure that there is no problem in your code and integration and next the problem occurs when you click checkout it takes more time and at last you get an error "could not connect to host error no 7". Lets solve this by simple understanding that the problem is in with the curl execution, open up your code and add this line in the curl parameters curl_setopt($ch, CURLOPT_TIMEOUT , 60); this make the curl execution for just 60 seconds and you can see the error in 60 secs, dont need to wait so long. next find this line $httpResponse = curl_exec($ch); and change the line to $httpResponse = curl_exec($ch) or die ("could not conect"); Now execute the code you can get the error called could not connect to host.By this we come to know that the error was not in the code or in the api permissions, its all that your server is not supporting curl executions.