Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Round price in two decimal digits to send to the API #120

Open
lauramelos opened this issue Aug 30, 2021 · 1 comment
Open

Round price in two decimal digits to send to the API #120

lauramelos opened this issue Aug 30, 2021 · 1 comment
Assignees

Comments

@lauramelos
Copy link

Describe the bug
WooCommerce support more that 2 digit on their setting, this enables merchants to connect with some ERP systems that required this due to rounding issues. We need to round the values to be sent to the API so we avoid the error response:

 "InvalidParameterValue": [
            "The value '0.9000' provided for 'chargeAmount.Amount' is invalid."
        ]

Reference report: https://wordpress.org/support/topic/prices-4-digits-and-no-payment-possible/

To Reproduce
Steps to reproduce the behavior:

  1. Set WooCommerce to work with more than 2 decimal digits
  2. try to perform a purchase (will be on error)
  3. Check the error log

Expected behavior
Amazon pay should be able to handle payments on store that use more that 2 decimal digits on their prices.

Isolating the problem (mark completed items with an [x]):

  • [ x ] I have deactivated other plugins and confirmed this bug occurs when only the extension is active.
  • [ x ] I can reproduce this bug consistently using the steps above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants