DoDirectPayment失败:无法连接到主机(7) [英] DoDirectPayment failed: couldn't connect to host(7)

查看:109
本文介绍了DoDirectPayment失败:无法连接到主机(7)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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失败:无法连接到主机(7)"

"DoDirectPayment failed: couldn't connect to host(7)"

我不知道出了什么问题.

I have no clue what's the problem.

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

Note: I am using local WAMP server for running this sample.

推荐答案

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

这篇关于DoDirectPayment失败:无法连接到主机(7)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆