UNPROCESSABLE_ENTITY / ITEM_TOTAL_MISMATCH
-
Hi,
I want to switch from the previous Plugin “PayPal Plus for WooCommerce” to the new “WooCommerce PayPal Payments” Plugin.
I’ve setup the plugin in my staging environment with a PayPal Sandbox Account.
When I have a product in cart, depending on the quantity, there seems to be incorrect rounding, so that for some quantities the Checkout process is successful and for other quantities the checkout throws an error.
It’s just a single product with a price of 1,99€ including taxes. No extra fees are applied by a variation or bulk discount or whatever.
F.e. at a quantity of 9, it fails.
Here is the log message:
2022-07-14T09:21:24+00:00 DEBUG POST https://api.sandbox.paypal.com/v2/checkout/orders Request Body: {"intent":"CAPTURE","purchase_units":[{"reference_id":"default","amount":{"currency_code":"EUR","value":"21.56","breakdown":{"item_total":{"currency_code":"EUR","value":"15.05"},"shipping":{"currency_code":"EUR","value":"3.07"},"tax_total":{"currency_code":"EUR","value":"3.44"}}},"description":"","items":[{"name":"Verkleberakel mit Filzkante","unit_amount":{"currency_code":"EUR","value":"1.67"},"quantity":9,"description":"Unser Verkleberakel mit Filzkante, ist das ideale Werkzeug, um Folien einfach und ohne Kratzer zu verkleben.\r\n\r\nDurch den flexi","sku":"SP-ZH-00002","category":"PHYSICAL_GOODS"}],"payee":{"merchant_id":"RVGS7CS2756VN"},"shipping":{"name":{"full_name":"David Ehrhardt"},"address":{"country_code":"DE","address_line_1":"Alexisweg 2","admin_area_2":"Arnstadt","postal_code":"99310"}}}],"application_context":{"user_action":"CONTINUE","shipping_preference":"GET_FROM_FILE","landing_page":"LOGIN","locale":"de-DE","brand_name":"Stickerplot","return_url":"https:\/\/stickerplot.local\/?wc-ajax=ppc-return-url&elementor_page_id=94","cancel_url":"https:\/\/stickerplot.local\/kasse\/"},"payer":{"name":{"given_name":"David","surname":"Ehrhardt"},"email_address":"[email protected]","address":{"country_code":"DE","address_line_1":"Alexisweg 2","admin_area_1":"DE-TH","admin_area_2":"Arnstadt","postal_code":"99310"}},"payment_method":{"payee_preferred":"UNRESTRICTED","payer_selected":"PAYPAL"}} Response Debug ID: 7789fe138eac1 Response: Array ( [code] => 422 [message] => Unprocessable Entity ) Response Body: {"name":"UNPROCESSABLE_ENTITY","details":[{"field":"/purchase_units/@reference_id=='default'/amount/breakdown/item_total/value","value":"15.05","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":"7789fe138eac1","links":[{"href":"https://developer.paypal.com/docs/api/orders/v2/#error-ITEM_TOTAL_MISMATCH","rel":"information_link","method":"GET"}]} 2022-07-14T09:21:24+00:00 WARNING Failed to create order. PayPal API response: [UNPROCESSABLE_ENTITY] The requested action could not be performed, semantically incorrect, or failed business validation. https://developer.paypal.com/docs/api/orders/v2/#error-ITEM_TOTAL_MISMATCH 2022-07-14T09:21:24+00:00 ERROR Order creation failed: [UNPROCESSABLE_ENTITY] The requested action could not be performed, semantically incorrect, or failed business validation. https://developer.paypal.com/docs/api/orders/v2/#error-ITEM_TOTAL_MISMATCH 2022-07-14T09:25:13+00:00 DEBUG GET https://api.sandbox.paypal.com/v1/notifications/webhooks Response Debug ID: 605d7cbb4f5ee Response: Array ( [code] => 200 [message] => OK ) 2022-07-14T09:25:15+00:00 DEBUG GET https://api.sandbox.paypal.com/v1/notifications/webhooks Response Debug ID: 852bbb3cafe08 Response: Array ( [code] => 200 [message] => OK )
I would really appreciate some help.
The page I need help with: [log in to see the link]
- The topic ‘UNPROCESSABLE_ENTITY / ITEM_TOTAL_MISMATCH’ is closed to new replies.