Hi there,
We are using the Click and Pledge Payment gateway with Woocommerce and have had no issues until we needed to apply sales tax to one of our products. The error appears when tax is applied to customers in Texas who order more than 1 of the product. No tax is applied out of state, and those orders do not have the error.
I have tried multiple configurations with how tax is applied, and nothing has removed the error other than removing sales tax from the product altogether.
This is the product: https://mkids.staging.wpengine.com/p...-registration/
It looks to me like it could be an issue with how Click and Pledge or Woocommerce is rounding decimals?
What can we do to remove this error so that the sales tax can be correctly applied to Texas orders?
We figured out the error. It was in clickandpledge-request.php
The $order_tax was 10.8075 and the $order_shipping_tax was 0.99. Adding them together before rounding gave a total tax of 10.80, but summing up the shipping tax and multiplying out the unit tax of 2.16*5 gave a total tax of 10.79 causing the request to fail validation. I've edited the file to round before summing the two values, but I don't think that is the correct solution. Either the $order_tax should be calculated by summing the rounded values or the xml request should use extended precision for the unit tax values.
We are using the Click and Pledge Payment gateway with Woocommerce and have had no issues until we needed to apply sales tax to one of our products. The error appears when tax is applied to customers in Texas who order more than 1 of the product. No tax is applied out of state, and those orders do not have the error.
I have tried multiple configurations with how tax is applied, and nothing has removed the error other than removing sales tax from the product altogether.
This is the product: https://mkids.staging.wpengine.com/p...-registration/
It looks to me like it could be an issue with how Click and Pledge or Woocommerce is rounding decimals?
What can we do to remove this error so that the sales tax can be correctly applied to Texas orders?
We figured out the error. It was in clickandpledge-request.php
The $order_tax was 10.8075 and the $order_shipping_tax was 0.99. Adding them together before rounding gave a total tax of 10.80, but summing up the shipping tax and multiplying out the unit tax of 2.16*5 gave a total tax of 10.79 causing the request to fail validation. I've edited the file to round before summing the two values, but I don't think that is the correct solution. Either the $order_tax should be calculated by summing the rounded values or the xml request should use extended precision for the unit tax values.
Comment