← Questions

Split-tender payments with gift cards, surcharges and refunds

0
StripeCodingLast asked Oct 2026

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.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding