PayPal Express Checkout – Error Code: 10431
-
Hi
I have been getting a lot of PayPal Express Checkout – Error Code: 10431 errors and submitted the problems to Paypal who said the following. Hope you can help out…
When checking the request your system sent to PayPal, I found this item number in the request:
42.950000000001
while PayPal was expecting 42.95. And thus the amount doesn’t correspond with other parts of the request.Please check the source code on your system and make sure the prices are correct in the request.
The deeper reason of this is actually a common floating point number issue which is present in all programming languages, that the last digits of floating point numbers are not accurate. It is why floating point numbers are not to be compared with “=” sign in programming languages. There is some more information here:
https://stackoverflow.com/questions/2896013/manipulating-and-comparing-floating-points-in-javaI would guess (from my experience) that the problem is with the plugin, because if a platform or a plugin is wisely designed, they should have logics encapsulated, which means PayPal logics go to PayPal plugin.
- The topic ‘PayPal Express Checkout – Error Code: 10431’ is closed to new replies.