• Resolved ajna667

    (@ajna667)


    checkout error when paying with paypal when a prduct is buy twice or more, and if product have a price on woocoerce with more than 2 number after the comma like 10,547€. problem with rounding?

    UNPROCESSABLE_ENTITY – Should equal sum of (unit_amount * quantity) across all items for a given purchase_unit

    on log:

    2022-11-19T09:54:06+00:00 DEBUG <------------------- WebToffee PayPal Express Payment ( Response on Create Order API ) ------------------->
    {
        "name": "UNPROCESSABLE_ENTITY",
        "details": [
            {
                "field": "\/purchase_units\/@reference_id=='default'\/amount\/breakdown\/item_total\/value",
                "value": "24.73",
                "issue": "ITEM_TOTAL_MISMATCH",
                "description": "Should equal sum of (unit_amount * quantity) across all items for a given purchase_unit"
            }
        ],
        "message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
        "debug_id": "7dbbbf2efe86f",
        "links": [
            {
                "href": "https:\/\/developer.paypal.com\/docs\/api\/orders\/v2\/#error-ITEM_TOTAL_MISMATCH",
                "rel": "information_link",
                "method": "GET"
            }
        ]
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support WebToffee Support

    (@webtoffeesupport)

    Hi @ajna667,

    Greetings from WebToffee support. Thanks for reaching out to us.

    The error message “UNPROCESSABLE_ENTITY – Should equal sum of (unit_amount * quantity) across all items for a given purchase_unit” is due to the price difference calculated by WooCommerce and PayPal.

    Due to rounding off of tax calculations, there will be a slight mismatch between the total calculated by WooCommerce and PayPal. Since the individual line items and their quantity information is passed to PayPal, the total is separately calculated by WooCommerce and PayPal. Sometimes, the total calculated by PayPal will be a little bit different from that calculated by WooCommerce. The error message is usually displayed because of this mismatch.

    We can avoid this calculation mismatch by sending only the total amount to PayPal. We created a code snippet to achieve this requirement. Please note that, by doing so, you will not be able to see the price of individual line items from your PayPal account anymore, only the total order amount. We hope it is clear.

    Please copy the code snippet from here and paste it into your child theme’s function.php file.
    (WordPress Dashboard > Appearance > Theme Editor > functions.php)

    Kindly check using the snippet and let us know how it goes.

    Thread Starter ajna667

    (@ajna667)

    ok thinks I’ll try your snippet

    Plugin Support WebToffee Support

    (@webtoffeesupport)

    Hi @ajna667,

    Did you check with the snippet? Let us how it went.

    Plugin Support WebToffee Support

    (@webtoffeesupport)

    Hi @ajna667,

    Assuming that you were able to solve the issue using the shared code snippet, we are marking this thread as resolved. Please start a new topic if you need any further assistance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘UNPROCESSABLE_ENTITY when buy 2 products with more than 2 number after comma’ is closed to new replies.