The six mechanisms
1. A balance that cannot lie
Money in a wallet should be the sum of everything that ever happened to it. The sound design is a ledger: every movement is a row, and the balance is derived from the rows. MelaOne's ledger is append-only, enforced by database rules, and a cached balance is checked against it.
2. Atomic spending
A payment must either complete entirely or not at all: validate, price, debit and create the order together. MelaOne does this in one database transaction, with the wallet row locked so two simultaneous payments cannot both spend the same money.
3. Idempotency
Phones retry. People double-tap. A payment endpoint must recognise a repeat and return the original result. MelaOne's requests carry a unique key per attempt; reusing a key with a different basket is rejected.
4. A credential that resists guessing
A 4-digit PIN protected by escalating lockout, a server-held key for hashing, and the ability to block and replace — see wallet PIN security.
5. Reversals
Orders get rejected. A good wallet reverses the amount as a new entry rather than editing history, restores stock and tells the customer. MelaOne does this automatically.
6. Refunds and closure
Unused balance needs a way out under written rules, and a closed wallet must stay closed unless an order is still in flight.
Limits and caps
Maximum balance, minimum and maximum single recharge and a per-event refund policy keep exposure bounded. MelaOne enforces them on the server.
Prepaid does not mean unregulated
Holding customers' prepaid money can be subject to payment-systems regulation, with rules on who may issue prepaid instruments, how funds must be held and what disclosures are needed. MelaOne is software; it does not issue, hold or settle funds and makes no regulatory claim. Get qualified advice before you operate.
How to judge a product
Ask a vendor: Is the ledger append-only? Are payments idempotent? Can I block and replace a card? What happens offline? Can an admin edit a balance? MelaOne's answers: yes, yes, yes, nothing is approved offline, and no.
Related
Digital wallet for events, anonymous QR wallets and the guide to implementing a prepaid wallet at a festival.
Frequently asked questions
Is a balance stored or computed?
A cached balance is stored for speed and guarded by a non-negative rule; the ledger is the source of truth and reports re-add it.
Can the same PIN protect several wallets?
Each wallet has its own PIN hash, bound to the wallet.
What stops a negative balance?
A database constraint and the locked, atomic payment step.
Does MelaOne hold the money?
No. Operators receive visitors’ payments at the recharge counters.
What happens at the end of the event?
Unused balance is refunded under your rules; wallets are closed.
