尝试使用cURL从我的服务器连接到PayPal-SandBox,连接在大约2分钟后停顿并超时.
我正在使用文档中的example call:
curl -v --insecure https://api-3t.sandBox.paypal.com/nvp -d "USER=platfo_1255077030_biz_api1.gmail.com&PWD=1255077037&SIGNATURE=Abg0gYcQyxQvnf2HDJkKtA-p6pqhA1k-KTYE0Gcy1diujFio4io5Vqjf&METHOD=SetExpressCheckout&VERSION=78&PAYMENTREQUEST_0_PAYMENTACTION=SALE&PAYMENTREQUEST_0_AMT=19&PAYMENTREQUEST_0_CURRENCYCODE=USD&cancelUrl=http://www.yourdomain.com/cancel.html&returnUrl=http://www.yourdomain.com/success.html"
外壳输出为:
* About to connect() to api-3t.sandBox.paypal.com port 443 (#0) * Trying 173.0.82.83... Connection timed out * couldn't connect to host * Closing connection #0 curl: (7) couldn't connect to host
当我尝试通过PHP卷曲这样做,我没有得到任何错误,只是一个空的资源句柄.
我可以轻松地从我的本地机器和我可以访问的其他服务器上执行请求(并获取正确的数据),所以我猜这是一些服务器端配置错误.不是服务器人,我有点无知.
libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.15 libssh2/1.2.6
openSSL也被启用.此外,当尝试连接到实时版本的API时,我遇到了相同的问题.
B)尝试添加自定义标题:-H“主机:api-3t.sandBox.paypal.com”
curl -v -insecure https://api-3t.sandBox.paypal.com/nvp -d“USER = platfo_1255077030_biz_api1.gmail.com& PWD = 1255077037& SIGNATURE = Abg0gYcQyxQvnf2HDJkKtA-p6pqhA1k-KTYE0Gcy1diujFio4io5Vqjf& METHOD = SetExpressCheckout& VERSION = 78& PAYMENTREQUEST_0_PAYMENTACTION = SALE& PAYMENTREQUEST_0_AMT = 19& PAYMENTREQUEST_0_CURRENCYCODE = USD& cancelUrl = http://www.yourdomain.com/cancel.html\u0026amp; returnUrl = http://www.yourdomain.com/success.html“-H”主持人:api-3t.sandBox.paypal.com“
C)什么版本的CURL和你在什么平台上使用?我有:
curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.21 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2