作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
关于这个错误的帖子有很多,但都不适用于我。我真的不明白为什么金额不匹配。我有匹配 AMT0 * QTY0 的 ITEMAMT。而AMT匹配ITEMAMT + SHIPPINGAMT。我一遍又一遍地检查文档,它确实应该以这种方式工作。当我完全移除它的运输时它会起作用......
结帐网址中的 AMT 也是 73.9。
我真的希望有人熟悉这个非常令人困惑的错误,并且知道我做错了什么......
提前致谢
Array
(
[TIMESTAMP] => 2013-01-24T22:56:09Z
[CORRELATIONID] =>
[ACK] => Failure
[VERSION] => 62.0
[BUILD] => 4181146
[L_ERRORCODE0] => 10413
[L_SHORTMESSAGE0] => Transaction refused because of an invalid argument. See additional error messages for details.
[L_LONGMESSAGE0] => The totals of the cart item amounts do not match order amounts.
[L_SEVERITYCODE0] => Error
)
Array
(
[PAYMENTREQUEST_0_PAYMENTACTION] => Sale
[L_PAYMENTREQUEST_0_NAME0] => XXXX
[L_PAYMENTREQUEST_0_NUMBER0] => 30533
[L_PAYMENTREQUEST_0_DESC0] => XXXX
[L_PAYMENTREQUEST_0_AMT0] => 30.95
[L_PAYMENTREQUEST_0_QTY0] => 2
[PAYMENTREQUEST_0_ITEMAMT] => 61.9
[PAYMENTREQUEST_0_TAXAMT] => 0
[PAYMENTREQUEST_0_SHIPPINGAMT] => 12
[PAYMENTREQUEST_0_INSURANCEAMT] => 0
[PAYMENTREQUEST_0_AMT] => 73.9
[PAYMENTREQUEST_0_CURRENCYCODE] => USD
[REQCONFIRMSHIPPING] => 1
[PAYMENTREQUEST_0_SHIPTOSTREET] => XXXX
[PAYMENTREQUEST_0_SHIPTOCITY] => XXXX
[PAYMENTREQUEST_0_SHIPTOSTATE] => XX
[PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE] => XX
[PAYMENTREQUEST_0_SHIPTOZIP] => XXXXXX
[PAYMENTREQUEST_0_SHIPTOPHONENUM] => XXXXXXXX
)
最佳答案
您发送的货币必须保留 2 位小数。您似乎只提供了 1 个。
$amt = 61.9;
$amt = sprintf("%.2f",$amt); // 61.90
Paypal 将返回此错误,因为金额格式不正确:
查看AMT
行下的表A.2
:
http://www.paypalobjects.com/en_US/ebook/PP_NVPAPI_DeveloperGuide/Appx_fieldreference.html
每次设置“金钱”参数时都应应用此规则。
关于php - Paypal API : The totals of the cart item amounts do not match order amounts,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14512491/
我是一名优秀的程序员,十分优秀!