So I have this issue with a website that I work on. It goes like so (note: This is not exactly what happens. I am just painting a picture):
Front-End:
- User has a cart full of things they want to buy
- Front-End calculates the amount that should be paid (this calculates in discounts, sales, Buy One Get One, etc.)
- User submits and pays the amount
Back-End:
- Items are bought and money is received
- Backend calculates a different amount for what everything should have cost
- Backend wants either less or more money
I think that I should calculate the amount in the same place. I think in step 2 I could make a call to the backend to determine what the amount should be.
That way I wouldn't run into this issue where they are calculating 2 different amounts. What do you guys think?