Split-tender payments with gift cards, surcharges and refunds
At a retail point of sale one purchase can be paid with several methods, for example part on a gift card and the rest on a credit card (a split-tender transaction). Write the code that processes a stream of payment events for such purchases and reports the outcome of each. Later parts add rules on top: gift cards that expire, a surcharge that depends on the ZIP code, and refunds that must go back to the right payment methods.
No answer yet. Write the first one; the best answer gets endorsed.
