• ketisrl

    (@ketisrl)


    Hi, I have a problem using YITH PayPal Express Checkout for WooCommerce plugin.
    At the checkout, if I select Paypal as payment method, this error has displayed:
    Errore PayPal (10413): Transaction refused because of an invalid argument. See additional error messages for details. – The totals of the cart item amounts do not match order amounts.
    In the logs file I see the total amounts doesn’t correspond to the result of the operation:
    (product1-price * quantity) + (product2-price * quantity) + …
    I think the problem is that I have set the number of decimal places for the product price to 4 in Woocommerce, but the plugin rounds the product price to 2 decimal places. It’s correct? Is there any way to fix this?
    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Alberto Ruggiero

    (@witcher83)

    Hello @ketisrl,
    unfortunately, it’s a limitation that comes from PayPal that we cannot circumvent. As you can read here: https://www.paypalobjects.com/en_US/ebook/PP_NVPAPI_DeveloperGuide/Appx_fieldreference.html about the AMT (amount) parameter it is specified:

    Total of order, including shipping, handling, and tax.
    Limitations: Must not exceed $10,000 USD in any currency. No currency symbol. Must have two decimal places, decimal separator must be a period (.), and the optional thousands separator must be a comma (,).

    Thread Starter ketisrl

    (@ketisrl)

    Thank you for your answer.
    The problem is not the 2 decimals places required but the check made from the plugin adding the items. This is an example taken from the logs file:

    [L_PAYMENTREQUEST_0_NAME0] => product1
    [L_PAYMENTREQUEST_0_AMT0] => 5.25
    [L_PAYMENTREQUEST_0_QTY0] => 42
    [L_PAYMENTREQUEST_0_NAME1] => product2
    [L_PAYMENTREQUEST_0_AMT1] => 3.26
    [L_PAYMENTREQUEST_0_QTY1] => 126
    [L_PAYMENTREQUEST_0_NAME2] => product3
    [L_PAYMENTREQUEST_0_AMT2] => 3.13
    [L_PAYMENTREQUEST_0_QTY2] => 126
    (5.25*42)+(3.26*126)+(3.13*126) =1025.64 <<<total

    [PAYMENTREQUEST_0_ITEMAMT] => 1025.38 <<<total calculated starting from the unit price with 4 decimal places and rounded to 2 decimal places

    1025.38 != 1025.64 so “The totals of the cart item amounts do not match order amounts”

    Is there the possibility to bypass the calculation and send to Paypal only the total?
    Thank you in advance

    Plugin Support Alberto Martin

    (@albertomrtn)

    Hi @ketisrl, no, unfortunately, it is not possible to skip this calculation.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘The totals of the cart item amounts do not match order amounts.’ is closed to new replies.