【问题标题】:DoDirectPayment failed: couldn't connect to host(7)DoDirectPayment 失败:无法连接到主机 (7)
【发布时间】:2011-07-20 05:38:26
【问题描述】:

我在 php 中使用 paypal 的示例代码 https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/library_code

但每当我运行此示例代码时,我都会收到此错误。

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

我不知道是什么问题。

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

【问题讨论】:

    标签: php paypal


    【解决方案1】:
    // Set the curl parameters.
    
    
     - $ch = curl_init();   
       curl_setopt($ch,   CURLOPT_PROXY, "   http://username:password@proxyserver.net: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  
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-26
      • 1970-01-01
      • 1970-01-01
      • 2018-04-06
      • 2020-07-15
      • 2012-01-23
      • 2020-11-30
      • 2020-07-28
      相关资源
      最近更新 更多