> For the complete documentation index, see [llms.txt](https://devmosaic.gitbook.io/devmosaic/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devmosaic.gitbook.io/devmosaic/resources/devmosaic-banking/cards-and-atm.md).

# Cards And ATM

### Card Config

```lua
Config.Cards = {
    enabled = true,
    issueCostCash = 50,
    maxPerAccount = 3,
    pinLength = 4,
}
```

### Card Designs

Cards are configured in:

```lua
Config.Cards.designs
```

Example:

```lua
{
    id = 'midnight',
    label = 'Midnight',
    background = 'linear-gradient(135deg, #0a0a0a 0%, #1a1d22 100%)',
    color = '#ffffff',
    accent = '#9ca3af',
}
```

You can add more designs by adding more entries with unique ids.

### Physical Card Item

```lua
Config.Cards.inventory = {
    enabled = true,
    resource = 'auto',
    item = 'bank_card',
    requireItemAtAtm = true,
    selectCardAtAtm = true,
    failIssueIfNoItem = false,
}
```

Options:

* `enabled`: use physical inventory cards.
* `resource`: inventory bridge.
* `item`: inventory item name.
* `requireItemAtAtm`: player must carry a card item at ATMs.
* `selectCardAtAtm`: open card selector before ATM.
* `failIssueIfNoItem`: card issue fails if inventory add fails.

### ATM Rules

```lua
Config.Cards.atm = {
    requireCard = true,
    requirePin = true,
    requireForDeposit = false,
    enforceDailyLimit = true,
    openAccountFromCard = true,
    allowPhysicalCardHolder = true,
}
```

Options:

* `requireCard`: card is required at ATM.
* `requirePin`: PIN is required.
* `requireForDeposit`: deposit requires card too.
* `enforceDailyLimit`: card daily withdrawal limit is enforced.
* `openAccountFromCard`: ATM opens the account linked to the selected card.
* `allowPhysicalCardHolder`: the player carrying the physical card can use it even if they are not the card owner.

### Stolen Or Shared Card Behavior

To let another player use a card they physically carry:

```lua
Config.Cards.atm.openAccountFromCard = true
Config.Cards.atm.allowPhysicalCardHolder = true
```

They still need:

* the physical card item
* the correct PIN
* a card that is not frozen

### Frozen Cards

Frozen cards cannot be used at ATMs.

### Card Metadata

Physical card items should include metadata such as:

* card id
* card holder
* last 4 digits
* account id
* card type/design
