woocommerce / woocommerce-gateway-paypal-express-checkout

58 stars 65 forks source link

The totals of the cart item amounts do not match order amounts #861

Open strarsis opened 3 years ago

strarsis commented 3 years ago

Describe the bug

PayPal error (10413): An error (10413) occurred while processing your PayPal payment. Please contact the store owner for assistance.

And in PayPal error log:

[...] - WC_Gateway_PPEC_Client::_request: remote request to https://api-3t.paypal.com/nvp with params: Array
(
    [LOGOIMG] => [...]
    [HDRIMG] => [...]
    [PAGESTYLE] => 
    [BRANDNAME] => [...]
    [RETURNURL] => [...]
    [CANCELURL] => [...]
    [ADDROVERRIDE] => 1
    [LANDINGPAGE] => Billing
    [SOLUTIONTYPE] => Sole
    [PAYMENTREQUEST_0_PAYMENTACTION] => sale
    [PAYMENTREQUEST_0_INSURANCEAMT] => 0
    [PAYMENTREQUEST_0_HANDLINGAMT] => 0
    [PAYMENTREQUEST_0_CUSTOM] => 
    [PAYMENTREQUEST_0_INVNUM] => 
    [PAYMENTREQUEST_0_CURRENCYCODE] => EUR
    [PAYMENTREQUEST_0_AMT] => 27.22
    [PAYMENTREQUEST_0_ITEMAMT] => 23.32
    [PAYMENTREQUEST_0_SHIPPINGAMT] => 3.9
    [PAYMENTREQUEST_0_TAXAMT] => 0
    [PAYMENTREQUEST_0_SHIPDISCAMT] => 0
    [NOSHIPPING] => 0
    [EMAIL] => [...]
    [PAYMENTREQUEST_0_SHIPTONAME] => [...]
    [PAYMENTREQUEST_0_SHIPTOSTREET] => [...]
    [PAYMENTREQUEST_0_SHIPTOSTREET2] => 
    [PAYMENTREQUEST_0_SHIPTOCITY] => [...]
    [PAYMENTREQUEST_0_SHIPTOSTATE] => 
    [PAYMENTREQUEST_0_SHIPTOZIP] => [...]
    [PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE] => DE
    [PAYMENTREQUEST_0_SHIPTOPHONENUM] => [...]
    [L_PAYMENTREQUEST_0_NAME0] => [...]
    [L_PAYMENTREQUEST_0_DESC0] => [...]
    [L_PAYMENTREQUEST_0_QTY0] => 0.8
    [L_PAYMENTREQUEST_0_AMT0] => 14.9
    [L_PAYMENTREQUEST_0_NUMBER0] => [...]
    [L_PAYMENTREQUEST_0_NAME1] => [...]
    [L_PAYMENTREQUEST_0_DESC1] => 
    [L_PAYMENTREQUEST_0_QTY1] => 0.5
    [L_PAYMENTREQUEST_0_AMT1] => 11.9
    [L_PAYMENTREQUEST_0_NUMBER1] => [...]
    [L_PAYMENTREQUEST_0_NAME2] => [...]
    [L_PAYMENTREQUEST_0_DESC2] => 
    [L_PAYMENTREQUEST_0_QTY2] => 0.5
    [L_PAYMENTREQUEST_0_AMT2] => 10.9
    [L_PAYMENTREQUEST_0_NUMBER2] => [...]
    [METHOD] => SetExpressCheckout
    [VERSION] => 120.0
    [USER] => [...]
    [PWD] => [...]
    [SIGNATURE] => [...]
)

[...] - WC_Gateway_PPEC_Client::_process_response: acknowleged response body: Array
(
    [TIMESTAMP] => [...]
    [CORRELATIONID] => [...]
    [ACK] => Failure
    [VERSION] => 120.0
    [BUILD] => 55546657
    [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
)

To reproduce

  1. Add some products (WooCommerce Measurement Plugin).
  2. Try to start payment from checkout page. Notice the error message.

Expected behavior

Payment should work (proper PayPal ExpressCheckout API call that is accepted).

Environment (please complete the following information):