Events & commands ​
Server events ​
server
Local server events (AddEventHandler), fired with TriggerEvent after np_payments did the work. Use them for logs
(Discord, MDT), statistics or follow-up actions.
| Event | Arguments | Fired when |
|---|---|---|
np_payments:paid |
src, payment |
A payment settled (sheet, terminal, quick pay, auto-pay, Charge). payment is the ledger row |
np_payments:refunded |
ref, amount |
A refund went through |
np_payments:invoicePaid |
invoice |
An invoice, instalment or QR code was paid and its paid state was confirmed in the database |
np_payments:reconciliation_required |
ref, paymentOrDetails |
A durable charge, refund, or invoice settlement needs reconciliation. Charge intents and ambiguous invoice settlements remain processing; ambiguous refund movements remain refunding. Emitted after an unresolved balance movement and again at startup for unresolved rows. Inspect balances and reconcile manually; the resource never replays a charge or refund. |
AddEventHandler('np_payments:paid', function(src, payment)
if payment.amount >= 10000 then
sendToDiscord(('%s paid $%d at %s (%s)'):format(payment.name, payment.amount, payment.merchantLabel, payment.ref))
end
end)
AddEventHandler('np_payments:invoicePaid', function(invoice)
-- invoice = { id, cid, kind, merchant, amount, status = 'paid', paidRef, paidBy, paidAt, payee, category, reason, … }
if invoice.category == 'fine' then clearFine(invoice.cid, invoice.id) end
end)
payment.meta.resource is the resource that called the export, and payment.meta.metadata is what you passed as
opts.metadata.
Events np_payments listens to ​
| Event | From | Effect |
|---|---|---|
np_character:loaded / np_character:unloaded |
np_character | Character switch: an open checkout settles as dropped |
playerDropped |
FiveM | Open checkouts, split parts and approvals of that player end |
np_hud:notifyAction |
np_hud | A boss pressed Approve / Deny on an approval toast |
np_phone:invoicePaid |
np_phone | A mirrored invoice is claimed before the payee credit; a confirmed credit then marks it paid. Ambiguous credit or DB outcomes stay processing and require reconciliation |
Net events (np_payments:rpc, np_payments:push, np_payments:client:terminal, np_payments:client:cashAnim,
np_payments:server:sync) are internal. See the NUI contract.
Commands ​
| Command | Who | What |
|---|---|---|
/terminal |
Employees of a terminal business, on duty | Open the register |
/givecash [id] |
Everyone | Give cash to a player. Without an id, the closest within 3 m |
/paytest [kind] |
Permission node np_payments.admin, or everyone with Config.Debug |
Sample payments: checkout (default, $95 at Rob's Liquor), quick (parking pill with a stepper), split, later ($950 with pay later), terminal (with tip) |
Command names come from Config.Terminal.command, Config.GiveCash.command and Config.Admin.command.
np_payments.admin is granted in np_admin (see
Installation → Permissions). With np_admin running, the same samples are its staff
action Test payment under Resource tools (pick the sample; in game only).
Keys ​
| Where | Keys |
|---|---|
| Sheet | E (hold) pay · ↑ ↓ choose · TAB split · I items · L other ways · ESC cancel |
| Split | ↑ ↓ row · ← → amount · R rest · TAB / ESC leave |
| Tip | ← → preset · ↑ ↓ target · ENTER continue |
| Customer request | E (hold) pay · N / ESC decline · TAB change method |
| Register | ← → / ↑ ↓ customer · E (hold) send · right-click an item = −1 |
| PIN pad | digits · BACKSPACE · ENTER · ESC |
| Quick pill | E pay · TAB full sheet · ← → stepper |
| np_menu (on a player) | "Charge (terminal)", "Give cash" |