Skip to content

Split, tip & pay later ​

All three are off unless the caller turns them on per request: allowSplit = true, allowTip = true, allowLater = true (or a list of kinds). Terminal requests always allow split and tip.

Split ​

Split

TAB on the sheet opens the split. The bar on top shows the parts in their colours. Each row gets an amount:

  • Own accounts: cash $20 and the rest from checking, for example.
  • Nearby players: players within 5 m (Config.Split.distance) are listed under Add a nearby player. Phone contacts show by name, strangers as #42.

The hold button reads Hold to pay $65 in 3 parts once every dollar is assigned. At most 4 parts (Config.Split.maxParts), and the parts must add up to the total (split_sum otherwise).

What happens then:

  1. Every player part opens the same sheet on that player, for their amount, with the merchant and "from" the payer.
  2. The payer's sheet shows Waiting for others with a timer (45 s, Config.Split.timeout).
  3. Money a player pays is taken right away and held.
  4. When every player paid, the payer's own parts are charged and the payee is credited once, with the full amount.
  5. If a player declines, is busy, or the time runs out, all held money goes back and the payer's sheet is open again with the reason (split_failed, split_busy, timeout).

A split that ends up with one own account only is sent as a plain payment. The ledger row lists every part, so refunds go back to each payer.

Key Action
↑ ↓ Row
← → Amount. The step grows with the total: 1, 5, 10, 50 or 100
R Put the rest on this row
TAB / ESC Leave the split

Tip ​

Tip

With allowTip, the player picks a tip before paying: presets 0 / 10 / 15 / 20 % (Config.Tip.presets) or a custom amount up to Config.Tip.maxPct (100 %) of the amount.

Where the tip goes:

Request Tip goes to
tipTargets given The picked target: a player (src, into their bank) or an account (account id)
No tipTargets The payee, with the payment
Terminal request The cashier who sent it
lua
allowTip = true,
tipTargets = {
  { id = tostring(cashierSrc), src = cashierSrc, label = 'Jamie Ortiz', sub = 'cashier on duty' },
  { id = 'jar', account = 'burgershot_tips', label = 'Tip jar', sub = 'whole shift' },
},

The result has tip (the amount) next to amount. ← → change the preset, ↑ ↓ the target, ENTER continues.

Pay later ​

Pay later

With allowLater, Other ways to pay (L) lists:

Kind What it does
invoice Invoice me: an invoice due in 3 days (Config.Later.invoice.days). After that, 10 % of the open amount is added once (lateFee)
instalments Instalments: 4 invoices, one every 7 days, with a 4 % fee added once and split evenly (the remainder goes on the last one). Only for amounts of $500 or more
qr Pay by phone: a 6-character code anyone can pay in the Pay app within 1 day. Good for a friend paying

allowLater = { 'invoice', 'qr' } offers only those kinds. Kinds switched off in Config.Later never show.

After the player picks one, the sheet shows the invoice number (or the QR code) and closes. The caller gets { ok = false, reason = 'later', invoice = <id>, kind, code? }: the money is not paid yet. Decide in your resource whether that is enough to hand over the goods. Shops usually pass allowLater = false.

Open invoices:

  • show in the Pay app under To pay, and the player pays them there with any account,
  • can also be mirrored into the np_phone Wallet (Config.Later.invoice.mirrorPhone, off by default). Paying there marks them paid here too,
  • credit the payee when paid, and fire np_payments:invoicePaid.

Before either payment path moves money, the invoice is claimed as processing. It becomes paid only after that state is saved and confirmed. A failed or ambiguous charge, payee credit, or paid-state write stays processing, emits np_payments:reconciliation_required, and cannot be charged again automatically. invoicePaid fires only for a confirmed paid row.

Late fees are checked every 60 s (Config.Later.tick). To bill a player without a checkout (a fine, a repair bill), use the Invoice export.