2011-03-22 25 views
0

我使用的PHP贝宝的示例代码,但每当我运行此示例代码我得到这个错误。DoDirectPayment失败:无法连接到从 <a href="https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/library_code" rel="nofollow">https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/library_code</a></p> <p>主机(7)

“DoDirectPayment失败:无法连接到主机(7)”

我不知道是什么问题。

注意:我使用本地WAMP服务器来运行此示例。

回答

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

感谢塞克里希纳这段代码正在工作。 – Vivart 2011-03-22 08:34:35

相关问题