【问题标题】:Express Checkout DPaypal PHP working live but failing in sandboxExpress Checkout DPaypal PHP 实时工作但在沙箱中失败
【发布时间】:2017-06-29 07:02:50
【问题描述】:

我正在使用这个库: https://github.com/amirduran/duranius-paypal-rest-api-php-library

在实时模式下一切都很好,但是当我尝试使用沙盒时,我得到:int(35)

$requestParameters = array(
            "USER" => $this->username,
            "PWD" => $this->password,
            "SIGNATURE" => $this->apiSignature,
            "METHOD" => $method,
            "VERSION" => $this->apiVersion,
        );

        $requestParameters+=$requestData;
        $finalRequest = http_build_query($requestParameters);

        $ch = curl_init();
        $this->curl=$ch;

        $curlOptions=$this->getcURLOptions();
        $curlOptions[CURLOPT_POSTFIELDS]=$finalRequest;

        curl_setopt_array($ch, $curlOptions);
        $serverResponse = curl_exec($ch);

curl_getinfo($ch) 结果:

  array(26) {
  ["url"]=>
  string(37) "https://api-3t.sandbox.paypal.com/nvp"
  ["content_type"]=>
  NULL
  ["http_code"]=>
  int(0)
  ["header_size"]=>
  int(0)
  ["request_size"]=>
  int(0)
  ["filetime"]=>
  int(-1)
  ["ssl_verify_result"]=>
  int(1)
  ["redirect_count"]=>
  int(0)
  ["total_time"]=>
  float(0.228482)
  ["namelookup_time"]=>
  float(0.027594)
  ["connect_time"]=>
  float(0.175784)
  ["pretransfer_time"]=>
  float(0)
  ["size_upload"]=>
  float(0)
  ["size_download"]=>
  float(0)
  ["speed_download"]=>
  float(0)
  ["speed_upload"]=>
  float(0)
  ["download_content_length"]=>
  float(-1)
  ["upload_content_length"]=>
  float(-1)
  ["starttransfer_time"]=>
  float(0)
  ["redirect_time"]=>
  float(0)
  ["redirect_url"]=>
  string(0) ""
  ["primary_ip"]=>
  string(11) "173.0.82.83"
  ["certinfo"]=>
  array(0) {
  }
  ["primary_port"]=>
  int(443)
  ["local_ip"]=>
  string(13) "192.168.1.100"
  ["local_port"]=>
  int(53117)
}

如果我只是将 url 更改为 https://api-3t.paypal.com/nvp 我会得到成功或失败的响应。 我已经检查了所有凭据,清理了所有 cookie,登录了真实帐户和沙盒帐户,几个月前我已经使用过它,没有任何问题。

谢谢!

【问题讨论】:

    标签: php curl paypal express-checkout nvp


    【解决方案1】:

    显然问题出在 openssl 版本上。 我通过在我的计算机上安装最后一个版本的 Mamp (4.1.1) 和 php 7.1 并更改服务器上的 php 版本来解决它。现在一切正常! ^.^

    【讨论】:

      猜你喜欢
      • 2016-06-21
      • 2016-03-15
      • 2016-05-20
      • 1970-01-01
      • 2011-07-14
      • 2012-06-07
      • 1970-01-01
      • 2012-08-31
      • 2022-08-15
      相关资源
      最近更新 更多