-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Taken from #178
If you try to make an order level adjustment and then a new payment to process a refund for an order, the system will try to do two things
- Create a 'refund transaction' with the amounts of the entire order
- Create brand new transaction with the new order amount
However, order level adjustments are not taken into account when reporting the total order amount to Taxjar. This causes Taxjar to throw an error when trying to report the new amount.
As discussed in #178, this scenario is handled by allowing users to configure a custom discount_calculator
which will let them determine how to handle splitting the discount among items for order level adjustments if desired.
However, as discovered in the testing of #139, order level adjustments will cause the creation of the "refund+new transaction" to fail silently and put your TaxJar reporting into a bad state (the order has been fully refunded, but a new transaction has not been created with the reduced amount)
To prevent this from happening, we should do the following.
- If an order has order level adjustments, a custom discount calculator has not been configured, and the order is about to be posted to taxjar
a.) We should short circuit reporting and not post the full refund OR new reduced amount transaction (currently the full refund transaction is succeeding but the new reduced amount transaction is failing)
b.) We should display an error message to the user notifying them that the order was not reported to TaxJar
c.) We should add documentation describing how and why to use thediscount_calculator
option
d.) We should display a link to the documentation so they can learn how to handle order level adjustments if desired.