2013-07-15 197 views
0

我在使用經典的PayPal NVP API時遇到問題。這是抱怨總數不匹配,我真的不明白爲什麼。PayPal NVP API錯誤10413 - 購物車項目金額的總計與訂單金額不匹配

The NVP name-value pairs which are sent to Paypal 
array(19) { 
    ["METHOD"]=> 
    string(18) "SetExpressCheckout" 
    ["AMT"]=> 
    string(5) "48.00" 
    ["MAXAMT"]=> 
    string(5) "48.00" 
    ["RETURNURL"]=> 
    string(40) "http://vikingchallenge/site/payPalReturn" 
    ["CANCELURL"]=> 
    string(40) "http://vikingchallenge/site/payPalCancel" 
    ["REQCONFIRMSHIPPING"]=> 
    string(1) "0" 
    ["NOSHIPPING"]=> 
    string(1) "1" 
    ["LOCALECODE"]=> 
    string(2) "GB" 
    ["PAYMENTREQUEST_0_AMT"]=> 
    string(5) "48.00" 
    ["PAYMENTREQUEST_0_CURRENCYCODE"]=> 
    string(3) "GBP" 
    ["PAYMENTREQUEST_0_ITEMAMT"]=> 
    string(2) "40" 
    ["PAYMENTREQUEST_0_TAXAMT"]=> 
    string(4) "8.00" 
    ["PAYMENTREQUEST_0_DESC"]=> 
    string(6) "Adults" 
    ["PAYMENTREQUEST_0_ALLOWEDPAYMENTMETHOD"]=> 
    string(18) "InstantPaymentOnly" 
    ["L_PAYMENTREQUEST_0_NAME0"]=> 
    string(6) "Adults" 
    ["L_PAYMENTREQUEST_0_DESC0"]=> 
    string(6) "Adults" 
    ["L_PAYMENTREQUEST_0_AMT0"]=> 
    string(2) "20" 
    ["L_PAYMENTREQUEST_0_QTY0"]=> 
    string(1) "2" 
    ["L_PAYMENTREQUEST_0_TAXAMT0"]=> 
    string(4) "8.00" 
} 

The response from Paypal 
array(9) { 
    ["TIMESTAMP"]=> 
    string(20) "2013-07-15T14:54:32Z" 
    ["CORRELATIONID"]=> 
    string(13) "f64e080a80db6" 
    ["ACK"]=> 
    string(7) "Failure" 
    ["VERSION"]=> 
    string(4) "92.0" 
    ["BUILD"]=> 
    string(7) "6868861" 
    ["L_ERRORCODE0"]=> 
    string(5) "10413" 
    ["L_SHORTMESSAGE0"]=> 
    string(94) "Transaction refused because of an invalid argument. See additional error messages for details." 
    ["L_LONGMESSAGE0"]=> 
    string(63) "The totals of the cart item amounts do not match order amounts." 
    ["L_SEVERITYCODE0"]=> 
    string(5) "Error" 
} 
+0

重複:http://stackoverflow.com/questions/10191209/paypal-api-the-totals-of-the-cart-item-amounts-do-not-match-order-amounts –

+0

這是一個不同的問題,在那個線程中,我有一個項目的數量。 –

回答

1

因爲您有此訂單項的qty = 2,請將L_PAYMENTREQUEST_0_TAXAMT0更改爲4.00。

METHOD=SetExpressCheckout 
CANCELURL=http://vikingchallenge/site/payPalCancel 
RETURNURL=http://vikingchallenge/site/payPalReturn 
MAXAMT=48.00 
REQCONFIRMSHIPPING=0 
NOSHIPPING=1 
LOCALECODE=GB 
PAYMENTREQUEST_0_AMT=48.00 
PAYMENTREQUEST_0_CURRENCYCODE=GBP 
PAYMENTREQUEST_0_PAYMENTACTION=SALE 
PAYMENTREQUEST_0_ITEMAMT=40 
PAYMENTREQUEST_0_TAXAMT=8.00 
PAYMENTREQUEST_0_DESC=Adults 
PAYMENTREQUEST_0_ALLOWEDPAYMENTMETHOD=InstantPaymentOnly 
L_PAYMENTREQUEST_0_NAME0=Adults 
L_PAYMENTREQUEST_0_DESC0=Adults 
L_PAYMENTREQUEST_0_AMT0=20 
L_PAYMENTREQUEST_0_TAXAMT0=4.00 
L_PAYMENTREQUEST_0_QTY0=2 
相關問題