← Back to work
Work

A 24-hour hold on the seller's share

The seller's share of every voucher sale waited 24 hours for a possible dispute.

↓

Why a code can't be refunded in kind

Once a buyer has read a code, it cannot be taken back. If the code was already used or is invalid, the only remedy is money.

The order

  • Buyers paid from a prepaid balance, topped up by crypto deposit or through a payment gateway.
  • Placing an order ran in one database transaction: the balance was debited, the codes marked sold, the order record created. The codes were returned in the response and emailed through a queue.
  • The seller's share was credited to a pending balance.

The hold

  • The hold length was agreed with the client after 6, 12 and 48 hours were weighed. A buyer might not have used a code by hour 6 or 12, and 48 hours kept sellers waiting too long. At 24, a buyer had time to find a bad code and raise a dispute before the money moved.
  • For those 24 hours the buyer could open one dispute on the order.
  • An hourly job released pending amounts older than 24 hours. Sellers waited 24 to 25 hours per sale.
  • Manual-delivery orders unfulfilled at 24 hours were refunded by a second job.
  • A dispute had no timeout. Closing it set the order back to pending, and the next hourly run paid the seller.

Where the clock started

The hold first counted from the time the order was placed. A code a seller delivered by hand at hour 23 left the buyer one hour to check it. Fulfilment became the start of the clock.

Codes resold after a refund

A refund put the codes back on sale. Nothing recorded that a previous buyer had seen them.

Voucher marketplace · backend · 2024 to 2025

Up next
An ffmpeg relay between every camera and Cloudflare→