• Resolved steveconnected

    (@steveconnected)


    Hi,
    Have a bit of a problem with trying to checkout some items, it looks like a decimal issue but only happens on some items! (I’ve posted the error I’m getting below).

    I have 3 item, each item has 2 options (I’m using the options to set postage costs).
    Price is set to £

    Product 1 is 11.99.
    Option 1 is 5 – FAILS
    Option 2 is 13.52 – FAILS

    Product 2 is 19.99.
    Option 1 is 5 – WORKS
    Option 2 is 13.52 – WORKS

    Product 3 is 37.99.
    Option 1 is 5 – WORKS
    Option 2 is 13.52 – FAILS

    The site is using the WP Twenty Twenty Template with Twentig.
    I’ve tried recreating the product that are erroring but that didn’t help.
    Advanced setting:
    Currency Position left (£1.00)
    Decimal Separator .
    Thousand Separator ,
    Number of Decimals 2

    Do you have suggestions?

    Error I’m getting
    `{“name”:”UNPROCESSABLE_ENTITY”,”details”:[{“field”:”/purchase_units/@reference_id==’default’/amount/breakdown/item_total/value”,”value”:”51.510000000000005″,”issue”:”DECIMAL_PRECISION”,”description”:”If the currency supports decimals, only two decimal place precision is supported.”}],”message”:”The requested action could not be performed, semantically incorrect, or failed business validation.”,”debug_id”:”78d561b4f6435″,”links”:[{“href”:”https://developer.paypal.com/docs/api/orders/v2/#error-DECIMAL_PRECISION”,”rel”:”information_link”,”method”:”GET”}]}

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thank you. We will check it out and give an update.

    Thread Starter steveconnected

    (@steveconnected)

    Hi,
    I’ve done a bit more digging and the error is on the json sent to Paypal.

    I think its this file
    wp-express-checkout\assets\js\public.js (and the min version)

    line 279 and 289 are outputting a “value” field to the json but its not rounding the value to 2 decimal places (as I need).

    I’ve testing it by using Math.round and it works but I’m aware this won’t be suitable fix as it doesn’t take into account the decimal setting in the plugin admin.

    But I hope this helps tracking down the issue!?

    This should be fixed in the new version. Please upgrade the plugin when you can.

    Thread Starter steveconnected

    (@steveconnected)

    Thats fixed it!

    Many thanks
    Steve

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Decimal Precision Error’ is closed to new replies.