0

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.

1 Answer 1

1
// 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  
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.