Gift cards
Selling, redeeming, part-redeeming and checking the balance of a gift card.
A gift card is created with a code, a face value and a zero balance. It is not spendable yet.
Creating a card records its face value but leaves it unfunded. The balance is only loaded once the sale that sells the card is actually recorded. Without this, a card could be issued, the sale voided, and the balance still spent — the shop paying for a card nobody bought.
/api/gift-cards and /api/gift-cards/redeem. A lifecycle rather than a screen, so it is drawn as a flow.Redeeming
Redemption takes the lesser of the amount asked for and the balance remaining, so a card can never go negative. A card with nothing left is marked depleted and is refused with a clear message rather than silently contributing zero.
Part payment
If the balance does not cover the sale, the payment screen tells you how much the card absorbs and asks for a second method for the rest. See Taking payment.