All products

np_payments

One checkout for every payment on the server. Shops, garages, mechanics, hospitals, tolls, fines and player-run businesses call one export. The sheet opens on top of their UI, the player picks an account and holds to pay, and the caller gets the result back.

v0.1.0qbx · qb · ESX · standaloneRequires oxmysql
Price TBAStore link follows at release
Installation guideDocumentation
Version
0.1.0
Frameworks
qbx, qb, ESX, standalone
Dependencies
oxmysql
Database
Tables created on start
Banking
np_banking, Renewed-Banking, qb-banking, okokBanking, esx_society
Inventory
np_inventory, ox_inventory, qb-inventory, ESX
Optional
np_hud, np_phone, np_menu, np_character
Languages
English, German
Build
Node 18+ to build the NUI once
Checkout at Rob's Liquor: personal, shared and business accounts with balances, the LSPD faction account greyed out with the reason, and hold E to pay $25
Checkout at Rob's Liquor: personal, shared and business accounts with balances, the LSPD faction account greyed out with the reason, and hold E to pay $25

Taken from the NUI in the browser at 1920×1080.

What's in it

The merchant, the amount and who gets the money always come from server code, never from the client.

One export, one sheet

  • Request waits until the player paid, cancelled or the request expired, then returns the result.
  • Items, tax and a merchant tile on top. The sheet sits above the caller's NUI.
  • Hold to pay with a fill that takes longer for bigger amounts.

Every account

  • Cash, checking, savings, shared accounts, business and faction accounts, and cards from the inventory.
  • Grouped as personal, shared and business, and faction.
  • Rows that can't pay stay in the list with the reason: over your limit, only on duty, not allowed here, frozen.

Business and faction rules

  • Daily limit per member or grade, allowed and blocked categories, on duty only, view-only members.
  • Boss approval: over the limit, every online boss gets Approve and Deny. The first decision wins.

Split, tip, pay later

  • Split between your own accounts or with nearby players, up to 4 parts.
  • Tips to the cashier or the business, from presets or a custom amount.
  • Invoices with a late fee, instalments, or a QR code a friend pays.

Terminal and cash

  • A register for employees on duty: product grid, custom amounts and a commission for the cashier.
  • Give cash to a nearby player with a stepper and a hand-over animation.

Quick pay

  • A small pill for tolls, parking, fuel and vending. E pays, TAB opens the full sheet.
  • A stepper for parking hours, and auto-pay per category up to a threshold.

PIN and receipts

  • PIN for cards and big charges on banking providers that support it. 3 wrong PINs block the card.
  • A toast for every outcome and an optional receipt item with the full metadata.

Ledger and safety

  • Every payment in the ledger, with full or partial refunds by reference.
  • Events for logging to Discord or your MDT.
  • Every NUI call goes through one rate-limited RPC with payload limits.

A closer look

The checkout

A server script calls Request. The sheet opens for that player and closes again when the payment is done.

  1. Pick an account: the default for the category is selected. ↑ and ↓ choose, L shows the items, TAB splits.
  2. Hold to pay: hold E until the fill is full. The hold scales from 0.7 s to 1.8 s with the amount.
  3. Result: accepted with a reference like PX-20481, declined with the real reason, or needs approval. Declined goes back to the list.
  4. Back to the caller: ok, the reference, the method, the amount and the tip. On failure the reason: cancelled, declined, timeout, busy or later.

Frosted glass by default, Liquid Glass as a setting. English and German, and balances can be hidden for streamers, server-wide or per player in the phone app.

Split, tip and pay later

Each one is switched on per request with allowSplit, allowTip and allowLater.

OptionHow it worksDefault
SplitBetween your own accounts, or with a nearby player who gets the same sheet for their part. Money is held until every part is paid and refunded if one fails or times out5 m, 45 s, 4 parts
TipA preset or a custom amount, to the cashier on duty or the business0, 10, 15, 20 %
InvoicePay within a few days. A late fee is added once when the due date passes3 days, +10 %
InstalmentsWeekly parts with a small fee, for bigger amounts4 × weekly, +4 %, from $500
QR codeA friend scans it and pays in the np_phone Pay app1 day

Invoices are mirrored to the np_phone Wallet. Paid there means paid here.

Player terminal

/terminal opens the register for employees of a terminal business, on duty. On np_menu it is also "Charge (terminal)" on a player.

  • Product grid per business from the config, plus a custom amount.
  • Players within 3 m to charge: phone contacts by name, strangers by number.
  • Commission in % to the cashier, the rest to the business account.
  • Rate-limited with a cooldown per customer. The customer sees the merchant, the items and the amount before paying.

Quick pay

For small, frequent charges, QuickPay shows a pill at the bottom of the screen instead of the sheet. E pays with the category's default method, TAB opens the full sheet.

Quick pay pill for parking at Legion Square: a stepper at 40 minutes for $8, the default card, E to pay and TAB for more

An optional stepper sets hours or litres with a price per step. Players can turn on auto-pay per category in the phone app, up to $25 by default, so a toll booth just opens.

Factions and approvals

Business and faction (society) accounts show up for their members, with rules the boss sets in the phone app.

RuleWhat it does
Daily limitPer member or grade. $250 by default, 0 means members can't spend
CategoriesAllowed and blocked categories, for example LSPD Expenses only for fuel, repairs and food
On duty onlyThe account only shows as payable while the member is on duty
View onlyMembers who see the account but can't spend from it
ApprovalOver the limit, every online boss gets an np_hud toast with Approve and Deny, or the phone app queue. The first decision wins, and the request declines after 60 s

Bosses are grade 4 and up (or the framework's boss flag). They have no limit and can refund from the app.

np_phone Pay app

With np_phone running, np_payments adds a Pay app.

Pay app: settings with a default method per category and auto-pay, the to-pay list with requests and receipts, and the LSPD Expenses boss view with an approval waiting
  • Settings: default method per category, auto-pay and streamer mode.
  • To pay: open bills and QR codes, pay one or all, and every receipt.
  • Boss: limits, categories, the duty rule, the live approval queue and refunds.

Without np_phone the checkout, approvals (as np_hud toasts) and invoices still work.

Set it up

Compatibility

Every bridge is detected at start, and every integration is optional and only called while that resource runs. No ox_lib.

KindSupported
Frameworkqbx_core, qb-core, es_extended, or standalone (an in-memory wallet, np_character aware)
Bankingnp_banking (accounts, cards, PINs and limits), Renewed-Banking, qb-banking or qb-management, okokBanking, esx_society (esx_addonaccount), or the framework's cash and bank
Inventorynp_inventory, ox_inventory, qb-inventory or ESX, for receipts and cards
UInp_hud for toasts and boss approvals, np_phone for the Pay app and the Wallet, np_menu for "Charge" and "Give cash" on players
Checkout innp_inventory shops, np_menu tuning and clothing, np_character stores, np_identification fees and np_tattoos parlours, each with Config.Payments
Your bankingAny other resource through RegisterProvider
np_bankingOther bankingFramework only
Cash and bank✓✓✓
Business and faction accounts✓✓–
Savings and shared accounts✓––
Cards and PINs✓––

Installation

The tables are created on start. You build the NUI once and add a receipt item.

  1. Put the resource in resources/ as np_payments.
  2. Build the NUI once (Node 18+):
    cd web && npm ci && npm run build
  3. Database: nothing to do with Config.AutoCreateTables = true. Otherwise import sql/np_payments.sql.
  4. On ox_inventory or qb-inventory, add a receipt item. np_inventory registers it on its own.
    ['receipt'] = { label = 'Receipt', weight = 5, stack = false, close = true },
  5. Start it after its dependencies:
    ensure oxmysql
    ensure qbx_core        # or qb-core / es_extended (optional)
    ensure np_banking      # optional, any supported banking resource works (before np_payments)
    ensure np_hud          # optional
    ensure np_phone        # optional
    ensure np_admin        # optional: permissions (np_payments.admin for /paytest), settings
    ensure np_payments
  6. Call Request from your own resources, or set Config.Payments in the NP DEV resources that support it.

For your own scripts

Server exports for the checkout, quick pay, charges without UI, invoices and refunds. Events fire on every payment, refund and paid invoice.

-- a shop purchase through the checkout (waits for the player)
local result = exports.np_payments:Request(source, {
  merchant = { id = 'robs_liquor_paleto', label = "Rob's Liquor", sub = 'Paleto Bay',
               icon = 'wine-bottle', tint = 'orange' },
  amount = 95, tax = 5, category = 'shop',
  items = { { label = 'A.M. Beer', qty = 2, price = 6 } },
  payee = { type = 'society', id = 'robsliquor' },
  receipt = true, allowSplit = true,
})
if result.ok then giveItems(source) end
-- result.ref, result.method, result.amount, result.tip, or result.reason

-- refund half of it later
exports.np_payments:Refund(result.ref, 47)

Questions

Do I need np_banking?

No. np_payments also reads accounts from Renewed-Banking, qb-banking or qb-management, okokBanking, esx_society, or the framework's cash and bank. Savings and shared accounts, cards and PINs need np_banking. np_payments picks it as its banking provider on start, so ensure np_banking first.

Can a cheater open a checkout with a fake price?

No. The merchant, amount and payee come from server code. Client code can only open merchants listed in Config.ClientMerchants, with rules and a maximum amount the client can't change.

Does it work without a framework?

Yes. Standalone gives each character an in-memory wallet (500 cash, 5000 bank by default) and uses np_character for the character id and name when it runs.

Do my other NP DEV resources use it?

np_inventory shops, np_menu tuning and clothing, np_character stores, np_identification fees and np_tattoos parlours have Config.Payments. 'auto' uses np_payments while it runs, true requires it and false never uses it.

What happens if a split part fails?

Money is held until every part is paid. If one part declines or times out, every part that was already paid is refunded.

Is it in German?

English and German, for the Lua messages and the NUI, set with Config.Locale.

Works well with

Build once, ensure it, call Request.

Installation, every config key and every export are in the docs.

Install np_payments