Line Item Quantity With 2 Decimals Fails - 10413 Error

codemilitant
Contributor
Contributor

I'm running Woocommerce in a WordPress website using the Divi theme.

 

OS:  CentOS Linux release 7.5.1804 (Core)

PHP 7.1.22 (cli) (built: Sep 13 2018 16:54:21) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

    with Zend OPcache v7.1.22, Copyright (c) 1999-2018, by Zend Technologies

    with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

WordPress:  4.9.8

 

I am running Woocommerce and I've modified the standard install to allow for a quantity out to 2 decimal places.

1.57, 2.39, 3.17, etc ...

 

The mods work great, and they're working well inside Woocommerce, however, when I submit for payment I get:

PayPal error (10413): An error (10413) occurred while processing your PayPal payment.

 

Of course, the line item amounts are not adding up to the order total amount.

 

Here's the API request and error:

[01-Dec-2018 16:53:22 UTC] WC_Gateway_PPEC_Client::_request: remote request to https://api-3t.sandbox.paypal.com/nvp with params: Array

(

    [LOGOIMG] => https://example.com/wp-content/uploads/2018/07/logo-150x150.png

    [HDRIMG] =>

    [PAGESTYLE] =>

    [BRANDNAME] => CodeMilitant

    [RETURNURL] => https://example.com/checkout/?woo-paypal-return=true

    [CANCELURL] => https://example.com/cart/?woo-paypal-cancel=true

    [ADDROVERRIDE] => 1

    [LANDINGPAGE] => Login

    [SOLUTIONTYPE] => Sole

    [PAYMENTREQUEST_0_PAYMENTACTION] => sale

    [PAYMENTREQUEST_0_INSURANCEAMT] => 0

    [PAYMENTREQUEST_0_HANDLINGAMT] => 0

    [PAYMENTREQUEST_0_CUSTOM] =>

    [PAYMENTREQUEST_0_INVNUM] =>

    [PAYMENTREQUEST_0_CURRENCYCODE] => USD

    [PAYMENTREQUEST_0_AMT] => 141.92

    [PAYMENTREQUEST_0_ITEMAMT] => 141.92

    [PAYMENTREQUEST_0_SHIPPINGAMT] => 0

    [PAYMENTREQUEST_0_TAXAMT] => 0

    [PAYMENTREQUEST_0_SHIPDISCAMT] => 0

    [NOSHIPPING] => 1

    [PAYMENTREQUEST_0_SHIPTONAME] => Tom <removed>

    [PAYMENTREQUEST_0_SHIPTOSTREET] => <removed>

    [PAYMENTREQUEST_0_SHIPTOSTREET2] =>

    [PAYMENTREQUEST_0_SHIPTOCITY] => Bristol

    [PAYMENTREQUEST_0_SHIPTOSTATE] => TN

    [PAYMENTREQUEST_0_SHIPTOZIP] => 37620

    [PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE] => US

    [L_PAYMENTREQUEST_0_NAME0] => Freelance Hourly Rate - 57

    [L_PAYMENTREQUEST_0_DESC0] =>

    [L_PAYMENTREQUEST_0_QTY0] => 1.23

    [L_PAYMENTREQUEST_0_AMT0] => 57

    [L_PAYMENTREQUEST_0_NAME1] => Freelance Hourly Rate - 43

    [L_PAYMENTREQUEST_0_DESC1] =>

    [L_PAYMENTREQUEST_0_QTY1] => 1.67

    [L_PAYMENTREQUEST_0_AMT1] => 43

    [METHOD] => SetExpressCheckout

    [VERSION] => 120.0

    [USER] => <removed>

    [PWD] => *******************

    [SIGNATURE] => ************************************************

)

 

[01-Dec-2018 16:53:23 UTC] WC_Gateway_PPEC_Client::_process_response: acknowleged response body: Array

(

    [TIMESTAMP] => 2018-12-01T16:53:23Z

    [CORRELATIONID] => d829ab70e4feb

    [ACK] => Failure

    [VERSION] => 120.0

    [BUILD] => 000000

    [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

)

 

I removed my private info.

 

As you can see, the quantities for each line item and out to 2 decimal places, and when added together, the line item totals are an exact match to the order total, however, it all fails.

 

Since I'm sending the correct info, and the line items and order total match, my guess is that PayPal does not allow for decimal quantities.

Does anyone have a suggestion for correcting this?

Thank you.

Login to Me Too
16 REPLIES 16

bmpf
Contributor
Contributor

Hello,

 

I was trying PayPal Express Checkout and I get this error when i try to buy something decimal like 1.25 

10413 - The totals of the cart item amounts do not match order amounts.

Capturar.JPG

 

 

Login to Me Too

bmpf
Contributor
Contributor

I made a mini plug in to bypass this. I have the plug in that comes with woocommerce active and its working now. I dont send all the information to paypal. Just the item and the full price of that same item. ( Quantity X Price ). 

Thank you.

Login to Me Too

uogecko
Contributor
Contributor

@bmpf I'm having the same issue using WooCommerce and the PayPal integration that comes with it.  You mentioned that you created a mini plugin that resolves the issue.  Could you share the plugin and/or give me some guidance on what you did?

Login to Me Too

bmpf
Contributor
Contributor

Hello @uogecko 

Its been too long. 

I rewrite the website from scratch ( with vue.js ) and put wordpress/woocommerce in the trash.

The website was becoming to big and wp/woocommerce was always with issues & slow. 

I think, I don't have the plug in anymore, I ll look for it and I ll let you know. 

Login to Me Too

uogecko
Contributor
Contributor

@bmpf  thank you!

Login to Me Too

angelleye
Advisor
Advisor

@bmpf WP/WC is going to be heavier than a Vue.js app, of course. However, if you're experiencing slowness with it, I would suggest you just need to adjust some things at the server level. I have plenty of clients running many thousands of products without any issues at all.

 

@uogecko Have you tried the latest version of WooCommerce and our plugin? There have been a lot of updates since this thread was first started. I haven't tested it specifically, but I know we aren't getting any other reports of this problem from our 60k+ active installs. You may want to give it another try if you haven't for a while.

 

If you do still have problems with it we can probably help you resolve it one way or another if you submit a ticket with us.

 

Angell EYE - www.angelleye.com
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
Login to Me Too

bmpf
Contributor
Contributor

I believe you @angelleye . But wp/wc its not working for me anymore. Too many issues regarding plug ins an themes, I rather build everything by myself, its so much easier to maintain and much faster.

For me, an eCommerce website that takes more than 1.5 seconds to load or changing page is a problem. With vue loading for the 1st time a page is like 500 ms , and changing the page is less than 50 ms. (With the same server and configs as wp/wc)

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.