I am trying to create an order with an ORDER scope discount but running into order total mismatch.
Lets say this is the order I created:
Items:
- Pizza : $12 [15% tax applies on it]
- Drink : $1 [NO tax applies]
Discount: $1
Items Total: $13
Discount: $1
SubTotal: $12
Tax: $1.65
Order Total: $13.65
Now when I send this order to Square, in the response what I get back is that the $1 discount applies to both the line items (Pizza and Drink). Pizza has discount of 92 cents and Drink has 8 cents.
Response has:
Pizza: $12
Discount: $0.92
Tax: $1.66
Item Total: $12.74
Drink: $1
Discount: $0.08
Tax: $0.0
Total: $0.92
Order Total In Response: $13.66
Which is 1 cent higher than it suppose to be which result in mismatch when we add the payment to this order with correct amount of $13.65
Issue is that the discount is being applied on all line items which mess up the line item tax amount and eventually the line item total.
Total mismatch grows more when we have more items in cart and more discounts.