PayPal API返回代码10400:缺少订单总数

时间:2017-06-03 15:24:58

标签: php api paypal

我正在尝试调用PayPal API命令SetExpressCheckout。

我传递的参数如下(URL参数):

METHOD=SetExpressCheckout
VERSION=2.7.1
PWD=PWD
USER=USER
SIGNATURE=SIG
PAYMENTREQUEST_0_AMT=1.36
PAYMENTREQUEST_0_PAYMENTACTION=Sale
RETURNURL=https://url/confirm/?id=ID
CANCELURL=https://url/cancel/?id=ID
PAYMENTREQUEST_0_CURRENCYCODE=EUR
REQCONFIRMSHIPPING=0
NOSHIPPING=1
L_PAYMENTREQUEST_0_NAME0=ITEM_NAME
L_PAYMENTREQUEST_0_AMT0=1.36
L_PAYMENTREQUEST_0_QTY0=1
L_PAYMENTREQUEST_0_ITEMCATEGORY0=Digital
BUTTONSOURCE=PP-ECWizard

我查看了很多其他说明相同问题的帖子,从答案中我似乎添加了所有必需的参数,包括订单总数(PAYMENTREQUEST_0_AMT)。

API返回以下内容(JSON):

{"TIMESTAMP":"2017-06-03T15:13:26Z","CORRELATIONID":"ID","ACK":"Failure","VERSION":"2.700000","BUILD":"34310309","L_ERRORCODE0":"10400","L_SHORTMESSAGE0":"Transaction refused because of an invalid argument. See additional error messages for details.","L_LONGMESSAGE0":"Order total is missing.","L_SEVERITYCODE0":"Error"}

我很欣赏以上任何一种帮助。

谢谢!

1 个答案:

答案 0 :(得分:0)

问题是我正在使用$ version的全局变量被覆盖。 API的错误是由于传递了VERSION参数。正确的版本param是98。