我正在使用这个库: 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,登录了真实帐户和沙盒帐户,几个月前我已经使用过它,没有任何问题。
谢谢!