gpt4 book ai didi

php - Paypal 购物车商品总金额与使用 npv 快速结账的订单金额不匹配

转载 作者:搜寻专家 更新时间:2023-10-31 20:37:14 28 4
gpt4 key购买 nike

这是我使用 nvp 和 express_checkout 发送到 paypal 的东西,但它给我错误不匹配订单金额,你能帮我看看我遗漏或计算错误的那个吗?

我已经阅读了有同样问题的帖子,但仍然不知道如何从他们建议的答案中解决我的问题。提前谢谢你。

Array
(
[METHOD] => SetExpressCheckout
[SOLUTIONTYPE] => Sole
[LANDINGPAGE] => Billing
[ALLOWNOTE] => 0
[PAYMENTREQUEST_0_PAYMENTACTION] => Sale
[PAYMENTREQUEST_0_AMT] => 70.00
[PAYMENTREQUEST_0_CURRENCYCODE] => AUD
[PAYMENTREQUEST_0_INVNUM] => 124-1440383961
[RETURNURL] => http://mysite.here/checkout/124/payment/return/I2Ir45QRcKkACL__OFbNrNjc8cL9Iajr0UU1LzXesWA
[CANCELURL] => http://mysite.here/checkout/124/payment/back/I2Ir45QRcKkACL__OFbNrNjc8cL9Iajr0UU1LzXesWA
[L_PAYMENTREQUEST_0_NAME0] => Babbling Brook - 7min Loop
[L_PAYMENTREQUEST_0_AMT0] => 35.00
[L_PAYMENTREQUEST_0_QTY0] => 1
[L_PAYMENTREQUEST_0_NUMBER0] => babblingbrook-7minloop
[L_PAYMENTREQUEST_0_NAME1] => Crackling Fire - 7min Loop
[L_PAYMENTREQUEST_0_AMT1] => 35.00
[L_PAYMENTREQUEST_0_QTY1] => 1
[L_PAYMENTREQUEST_0_NUMBER1] => cracklingfire-7minloop
[PAYMENTREQUEST_0_ITEMAMT] => 63.64
[PAYMENTREQUEST_0_TAXAMT] => 6.36
[NOSHIPPING] => 1
[USER] => myusernamehere
[PWD] => ANDPASSWORDHERE
[SIGNATURE] => A.bIs5s0FCBv.KdshBEZ.0y1BshsBr9
[VERSION] => 76.0
)

PayPal 服务器响应:

Array
(
[TIMESTAMP] => 2015-08-24T02:20:54Z
[CORRELATIONID] => 7b10ddf49b4c1
[ACK] => Failure
[VERSION] => 76.0
[BUILD] => 000000
[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
)

最佳答案

我上次玩这个我使用的是 API 版本 113(现在已经有一年多了)。

我认为您真的只漏掉了每件商品的税额。

PAYMENTREQUEST_0_ITEMAMT 字段应等于每件商品的不含税金额 (L_PAYMENTREQUEST_0_AMTn) 乘以数量的总和。所以你应该有

'L_PAYMENTREQUEST_0_AMT0' => 31.82,
'L_PAYMENTREQUEST_0_AMT1' => 31.82,
'PAYMENTREQUEST_0_ITEMAMT' => 63.64

PAYMENTREQUEST_0_TAXAMT 是每件商品的税额 (L_PAYMENTREQUEST_0_TAXAMTn) 乘以数量的总和。您尚未指定商品税额,但假设它类似于

'L_PAYMENTREQUEST_0_TAXAMT0' => 3.18,
'L_PAYMENTREQUEST_0_TAXAMT1' => 3.18,
'PAYMENTREQUEST_0_TAXAMT' => 6.36

最后,PAYMENTREQUEST_0_AMTPAYMENTREQUEST_0_ITEMAMTPAYMENTREQUEST_0_TAXAMT 加上任何运费的总和

'PAYMENTREQUEST_0_AMT' => 70.00

关于php - Paypal 购物车商品总金额与使用 npv 快速结账的订单金额不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32173881/

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