Php Paypal Adaptive Api支付错误无法打开流:HTTP请求失败!HTTP/1.0 400错误请求

Php Paypal Adaptive Api支付错误无法打开流:HTTP请求失败!HTTP/1.0 400错误请求,php,paypal,Php,Paypal,我使用的是自适应url,就像 $url = trim("https://svcs.".$sandbox."paypal.com/AdaptivePayments/Pay"); 我收到此错误消息:| |php错误消息=fopen(https://svcs.sandbox.paypal.com/AdaptivePayments/Pay):无法打开流:HTTP请求失败!HTTP/1.0 400错误请求|尝试使用urlencode(): 其中我使用urlencode()函数。我收到新错误:-fopen

我使用的是自适应url,就像

$url = trim("https://svcs.".$sandbox."paypal.com/AdaptivePayments/Pay");

我收到此错误消息:| |php错误消息=
fopen(https://svcs.sandbox.paypal.com/AdaptivePayments/Pay):
无法打开流:HTTP请求失败!HTTP/1.0 400错误请求|

尝试使用
urlencode()


其中我使用urlencode()函数。我收到新错误:-fopen(https%3A%2F%2fscs.sandbox.paypal.com%2FAdaptivePayments%2FPay):无法打开流:没有这样的文件或目录urlencode(“);相同错误fopen(https%3A%2F%2fscs.sandbox.paypal.com%2FAdaptivePayments%2FPay):无法打开流:没有这样的文件或目录$params=array(“http”=>array(“方法”=>“POST”,”内容“=>$body\u data”,标题“=>”X-PAYPAL-SECURITY-USERID:“.$API\u UserName.”\r\n“.”X-PAYPAL-SECURITY-SIGNATURE:“.$API\u SIGNATURE.”\r\n“.”X-PAYPAL-SECURITY-PASSWORD:“.$API\u PASSWORD.”\r\n“.”X-PAYPAL-APPLICATION-ID:“.$API\u AppID.”\r\n“.”X-PAYPAL-REQUEST-data-FORMAT:“$API\U RequestFormat.”\r\n“.”X-PAYPAL-RESPONSE-DATA-FORMAT:“..API\U ResponseFormat.”\r\n“.”X-PAYPAL-DEVICE-IPADDRESS:“..PROXY\U HOST.”\r\n“)@ramesh:使用文件获取内容(');我使用$ctx=stream\u context\u create($params);然后$response=stream\u get\u contents($fp);
$url = urlencode("https://svcs.".$sandbox."paypal.com/AdaptivePayments/Pay");