gpt4 book ai didi

php - Paypal API : The totals of the cart item amounts do not match order amounts

转载 作者:可可西里 更新时间:2023-11-01 14:03:53 27 4
gpt4 key购买 nike

关于这个错误的帖子有很多,但都不适用于我。我真的不明白为什么金额不匹配。我有匹配 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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com