Skip to content

Bank cards & PINs ​

A bank card is an inventory item (bank_card) that points at a card row on the server. The item carries only display data; the PIN, limits and state stay on the server.

Branch: cards desk

Getting a card ​

Characters don't get a card automatically. They order one:

  • at a branch counter for an account at that bank (Config.Cards.issueFee, default free), choosing a tier the bank offers and the PIN;
  • from your own resource with IssueCard ({ tier?, pin?, give? }), for example a job that hands out company cards.

An account has at most Config.Cards.maxPerAccount (4) active cards. The card's holder is a character, the money comes from the account the card is on. IssueCard trusts its caller: it checks the account and the card count, not the holder's role on the account. A card is valid for Config.Cards.expiryDays (56 real days).

Item metadata ​

lua
{ card = 'card_x1y2z3w4', bank = 'maze', tier = 'debit', last4 = '4412', holder = 'Aiden Pearce',
  expires = '11/26', label = 'Maze Debit', image = nil }

image is set when Config.Cards.imagePath is set (imagePath .. '<bank>_<tier>.png'). Using the item anywhere but at an ATM shows the card's number, expiry and state.

Tiers ​

Tier Daily limit Contactless up to Upgrade needs Banks
debit $5,000 $100 Maze, Fleeca, Pacific, Blaine, Lombank
gold $15,000 $150 $50,000 on the account Maze, Fleeca, Pacific
black $50,000 $250 $500,000 on the account Maze, Pacific
business $20,000 $150 Lombank
prepaid $2,000 $100 anonymous (via IssueCard)
cloned $1,500 $100 burns after 3 uses written by a skimmer, see Robberies

Which bank offers which tier is cardTiers in Config.Banks. The account owner can lower a card's daily limit in the Bank app (up to the tier's limit) and switch contactless off.

PINs ​

  • Config.Cards.pinLength digits (4). Set when ordering, changed in the Bank app (old PIN required once a PIN is set), at an ATM (Change PIN) or reset at the counter with an ID.
  • Stored as a salted SHA-256 hash with a server-only pepper (set np_banking_pin_pepper "…" in server.cfg). Never in the item metadata, never on the client. Don't change the pepper once PINs exist.
  • Config.Cards.maxTries (3) wrong PINs in a row block the card. At an ATM the card is also kept: the holder gets it back at a branch.

States ​

State Means Undo
ok Usable
frozen Frozen by the holder (app) or staff Unfreeze in the app
blocked Wrong PINs, reported stolen, burned (cloned card), blocked by a script Replace at a branch (Config.Cards.replaceFee, $50)
expired Older than Config.Cards.expiryDays (56 real days) Replace at a branch
account_frozen The account itself is frozen Staff unfreeze the account

A card that an ATM kept (three wrong PINs, or forgotten in the slot) is marked retained and handed back at a branch (Retrieve kept card).

Paying with a card ​

Every card charge goes through one check (the card exists and belongs to the account, its state, contactless, the daily limit):

  • Contactless payments above the tier's contactless amount, or with contactless switched off, answer pin_required.
  • The daily limit counts the card's spending over the last 24 hours.
  • Refused card payments push a declined notification to the holder's phone.

np_payments ​

With np_payments running, bank_card items in the inventory show as card rows in its checkout (np_payments' Config.Cards.items lists bank_card and credit_card). np_payments asks np_banking for the card (GetCardForItem), shows its PIN pad and checks the PIN with CheckPin. After 3 wrong PINs it calls BlockCard. Bank-account charges ask for a PIN too when Config.Accounts.pinForBankCharges = true.

Card alerts ​

When a card is used by someone else more than Config.Phone.push.farAwayMeters (250 m) from the holder, the holder's phone shows a Live Activity with a Freeze button. See Bank app → Pushes.

Bank app: cards Card used far away
Cards Card alert