Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/258.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php paypal-不支持错误代码81002方法_Php_Api_Paypal - Fatal编程技术网

Php paypal-不支持错误代码81002方法

Php paypal-不支持错误代码81002方法,php,api,paypal,Php,Api,Paypal,我的问题与此特定错误有关: 我正在做一个表单来包含必须传递到服务器才能获得令牌的数据,但可能我还不了解有关这样做的一些概念 这是我的表格 <form method="post" action="https://api-3t.sandbox.paypal.com/nvp"> <input type="hidden" name="USER" value="Apiuser"/> <input type="hidden" name="PWD" value="

我的问题与此特定错误有关:

我正在做一个表单来包含必须传递到服务器才能获得令牌的数据,但可能我还不了解有关这样做的一些概念

这是我的表格

<form method="post" action="https://api-3t.sandbox.paypal.com/nvp">
    <input type="hidden" name="USER" value="Apiuser"/>
    <input type="hidden" name="PWD" value="Apipass"/>
    <input type="hidden" name="SIGNATURE" value="Apisignature"/>
    <input type="hidden" name="VERSION" value="52.0"/>
    <input type="hidden" name="PAYMENTACTION" value="Sale"/>    
    <input name="AMT" value="19.95"/>
    <input type="hidden" name="RETURNURL" value="http://www.YourReturnURL.com"/>
    <input type="hidden" name="CANCELURL" value="http://www.YourCancelURL.com"/>
    <input type="image" name="METHOD" src="https://www.paypal.com/it_IT/IT/i/btn/btn_xpressCheckout.gif" value="SetExpressCheckout"/>
</form>
好像有什么不对劲,你能给我小费吗


非常感谢

您是否检查过没有对参数进行两次编码?我的例子是通过http_build_query()和一些默认设置发生的,这些默认设置由于运行时的某个地方被更改而不稳定

基本上,您的最终调用应该包含&而不是&,对于我来说,出于某种原因,最终的curl调用最终被编码为&

确保您没有对twize进行编码,如果使用http\u build\u query()更新您的函数,使其在编码部分显式显示:

from: http_build_query($requestParameters)

to: http_build_query($requestParameters,'','&')

不同之处在于,最后一个版本将显式使用&作为分隔符,而第一个版本将使用默认值,因此请确保。

您是否只是打印了用户名、密码和API签名供全世界使用?建议编辑是的…你对这个错误有什么想法吗?你检查了paypal API错误代码部分了吗?他们列出了你发送给paypal的URL中所有可能的错误代码和坏字符。最好的猜测。对不起,我帮不上忙了!贝宝是一个熊有时工作哪个网址?你是指键和值的字符串吗?
from: http_build_query($requestParameters)

to: http_build_query($requestParameters,'','&')