php - Paypal Curl 重定向问题

标签 php curl paypal

这是关于通过 Curl 的 Paypal 。我正在尝试使用以下代码访问 Paypal 。该代码在一台服务器上运行良好。将此代码移动到实时服务器后,出现以下错误。谁能告诉我解决方案。

     $API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
     $version = urlencode('76.0');
     $ch = curl_init();
        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);

        // Set the API operation, version, and API signature in the request.
        $nvpreq = "METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_";

        // Set the request as a POST FIELD for curl.
        curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);

        // Get response from the server.
        $httpResponse = curl_exec($ch);

错误:

SetExpressCheckout failed: Unknown SSL protocol error in connection to api-3t.sandbox.paypal.com:443 (35)

最佳答案

你能设置curl_setopt($ch, CURLOPT_SSLVERSION, 3);吗?

关于php - Paypal Curl 重定向问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20958547/

相关文章:

php - MySQL表分离几乎相同的数据但不同的用户组

php - Javascript 连接到 websocket

php - 使 CER 证书只能通过 Apache2 Web 服务器上的 CURL 访问

php - Paypal 定期付款停止

php - 如何从中央位置存储和访问SQLite数据库?

PHP cURL 不存储 session cookie...如何解决这个问题?

php - 高可用性 API - 这个解决方案好吗?

ios - 隐藏 PayPal MPL 的 UiAlert

php - Magento PayPal 重复发票错误

php - 为什么对引用值调用函数(例如 strlen、count 等)如此慢?