Reputation: 15313
I am using the sample code of paypal in php from https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/library_code
but whenever i am running this sample code i am getting this error.
"DoDirectPayment failed: couldn't connect to host(7)"
I have no clue what's the problem.
Note: I am using local WAMP server for running this sample.
Upvotes: 0
Views: 1236
Reputation: 1439
// Set the curl parameters.
- $ch = curl_init();
curl_setopt($ch, CURLOPT_PROXY, " http://username:[email protected]:port/";);
curl_setopt($ch, CURLOPT_URL, $API_Endpoint);
curl_setopt($ch, CURLOPT_VERBOSE, 1); // Turn off the server and peer //verification(TrustManager Concept).
curl_setopt($ch,
CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch,
CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch,
CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
//The rest of the code from paypal site
Upvotes: 1