• Resolved Domenik

    (@onyxdevelopment)


    Hello, for a few days we have had the following error message with some orders. We have changed absolutely nothing in the shop.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @onyxdevelopment

    What version of the plugin are you using?

    If you navigate to the WooCommerce > Status > Logs page there should be a “wc-ppcp” log file. Can you share the entry from that file?

    Are you using any plugins that alter the item totals based on certain conditions?

    Kind Regards,

    Thread Starter Domenik

    (@onyxdevelopment)

    hey,

    we have a plugin that counts the items and accordingly adds a discount based on the amount of items and item count

    The problem does not occur with every order, but also when this plugin does not intervene. Even if the plugin is deactivated and only the PayPal plugin is activated, the errors come

    [error] => Array
            (
                [name] => UNPROCESSABLE_ENTITY
                [details] => Array
                    (
                        [0] => Array
                            (
                                [field] => /purchase_units/@reference_id=='default'/amount/breakdown/item_total/value
                                [value] => 14.28
                                [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] => 5f9c335f4c479
                [links] => Array
                    (
                        [0] => Array
                            (
                                [href] => https://developer.paypal.com/docs/api/orders/v2/#error-ITEM_TOTAL_MISMATCH
                                [rel] => information_link
                                [method] => GET
                            )
    
                    )
    
            )
    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @onyxdevelopment

    Can you reach out to us via our contact us page? https://paymentplugins.com/contact-us/

    We’ve been testing a fix for this exact scenario. We’d like you to confirm on your end if possible.

    Kind Regards,

    Thread Starter Domenik

    (@onyxdevelopment)

    Okay done ??

    Hi, I’m also getting a similar error – I’m using version 1.0.16 of the plugin – my error is AMOUNT_MISMATCH.

    As you will see, my line items add up to 218.99, but the total amount charged is 219.00.

    I have “Round tax at subtotal level, instead of rounding per line” setting in WooCommerce enabled – I think that may be part of the issue, however I would like to use the PayPal plugin with this setting on.

    Would you be able to have a look at this please?

    Many thanks

    2022-12-14T18:00:56+00:00 ERROR API error: Array
    (
        [url] => https://api-m.paypal.com/v2/checkout/orders/[redacted]
        [method] => PATCH
        [request] => Array
    (
        [0] => Array
            (
                [op] => replace
                [path] => /purchase_units/@reference_id=='default'
                [value] => Array
                    (
                        [amount] => Array
                            (
                                [value] => 219.00
                                [currency_code] => GBP
                                [breakdown] => Array
                                    (
                                        [item_total] => Array
                                            (
                                                [currency_code] => GBP
                                                [value] => 209.60
                                            )
                                        [shipping] => Array
                                            (
                                                [currency_code] => GBP
                                                [value] => 9.52
                                            )
                                        [tax_total] => Array
                                            (
                                                [currency_code] => GBP
                                                [value] => 10.43
                                            )
                                        [discount] => Array
                                            (
                                                [currency_code] => GBP
                                                [value] => 10.56
                                            )
                                        [handling] => Array
                                            (
                                                [currency_code] => GBP
                                                [value] => 0.00
                                            )
                                    )
                            )
                        [invoice_id] => [redacted]
                        [custom_id] => [redacted]
                        [items] => Array
                            (
                                [0] => Array
                                    (
                                        [name] => [redacted]
                                        [quantity] => 20
                                        [unit_amount] => Array
                                            (
                                                [currency_code] => GBP
                                                [value] => 10.48
                                            )
                                    )
                            )
                        [description] => [redacted]
                        [shipping] => [redacted]
                        [reference_id] => default
                    )
            )
    )
    
        [error] => Array
            (
                [name] => UNPROCESSABLE_ENTITY
                [details] => Array
                    (
                        [0] => Array
                            (
                                [field] => /purchase_units/@reference_id=='default'/amount/value
                                [value] => 219.00
                                [issue] => AMOUNT_MISMATCH
                                [description] => Should equal item_total + tax_total + shipping + handling + insurance - shipping_discount - discount.
                            )
                    )
                [message] => The requested action could not be performed, semantically incorrect, or failed business validation.
                [debug_id] => 1eed400835ac8
                [links] => Array
                    (
                        [0] => Array
                            (
                                [href] => https://developer.paypal.com/docs/api/orders/v2/#error-AMOUNT_MISMATCH
                                [rel] => information_link
                                [method] => GET
                            )
                    )
            )
    )
    • This reply was modified 1 year, 11 months ago by trogdoor9432. Reason: Messed up code quote tags, sorry!
    Plugin Author Payment Plugins

    (@mrclayton)

    @trogdoor9432 Please update to the latest version of the plugin which is 1.0.17 and that should resolve that API error.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘ITEM_TOTAL_MISMATCH’ is closed to new replies.