Paypal 购物车商品总金额与使用 express_checkout 的 nvp 的订单金额不匹配

Paypal the totals of the cart item amounts do not match order amounts using nvp with express_checkout

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

我读过 post 遇到了同样的问题,但仍然不知道如何从他们建议的答案中解决我的问题。提前谢谢你。

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