> For the complete documentation index, see [llms.txt](https://duddzy-scripts.gitbook.io/duddzy-scripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://duddzy-scripts.gitbook.io/duddzy-scripts-docs/scripts/duddzy-jail-3/configuration-overview/payment-config.md).

# Payment Config

DZ Customs supports multiple payment methods and validates checkout pricing server-side.

Payment settings are configured in:

```
dz_customs/shared/config.lua
```

***

### Payment Methods

```lua
Config.PaymentMethods = {
    cash = true,
    bank = true,
    society = false
}
```

Available payment methods:

| Method    | Description                          |
| --------- | ------------------------------------ |
| `cash`    | Uses the player’s cash/money account |
| `bank`    | Uses the player’s bank account       |
| `society` | Uses a configured society account    |

***

### Enable or Disable Payment Methods

Enable cash and bank only:

```lua
Config.PaymentMethods = {
    cash = true,
    bank = true,
    society = false
}
```

Enable all payment methods:

```lua
Config.PaymentMethods = {
    cash = true,
    bank = true,
    society = true
}
```

Bank only:

```lua
Config.PaymentMethods = {
    cash = false,
    bank = true,
    society = false
}
```

The NUI automatically hides disabled payment methods.

***

### Default Payment Method

```lua
Config.DefaultPaymentMethod = 'bank'
```

Valid options:

```lua
'cash'
'bank'
'society'
```

The selected default must also be enabled in `Config.PaymentMethods`.

Example:

```lua
Config.PaymentMethods = {
    cash = true,
    bank = true,
    society = false
}

Config.DefaultPaymentMethod = 'cash'
```

***

### Currency Symbol

```lua
Config.Currency = '£'
```

This changes the currency symbol shown in the NUI, notifications, and logs.

Examples:

```lua
Config.Currency = '$'
Config.Currency = '€'
Config.Currency = '£'
```

This is display-only. It does not change the server economy or account logic.

***

### Server-Side Price Validation

DZ Customs does not trust prices sent from the NUI.

When a player checks out, the server recalculates:

* Basket item validity
* Duplicate basket entries
* Trusted item prices
* Final basket total
* Job discounts
* Free-job pricing
* Player balance
* Society balance, if enabled

This helps protect the resource from modified NUI data or client-side price abuse.

***

### Pricing File

Pricing is configured in:

```
dz_customs/shared/pricing.lua
```

This file controls default prices and mod pricing calculations.

Example default pricing section:

```lua
Config.Pricing.Defaults = {
    cosmetic = 1000,
    performance = 2500,
    paint = 750,
    wheels = 2500,
    neon = 2000,
    xenon = 1500,
    tyreSmoke = 1000,
    bulletproofTyres = 2500
}
```

***

### Checkout Flow

Standard checkout flow:

```
Player selects modifications
→ Items are added to basket
→ Player chooses payment method
→ Server validates basket
→ Server recalculates total
→ Server applies job pricing
→ Server charges player/society
→ Vehicle properties are saved if persistence is enabled
```

***

### Not Enough Money

If the player does not have enough money, checkout fails and no vehicle save is attempted.

The player receives a notification such as:

```
You do not have enough money.
```

***

### Invalid Payment Method

If a disabled or invalid payment method is sent to the server, checkout fails.

Make sure your NUI and config match:

```lua
Config.PaymentMethods
Config.DefaultPaymentMethod
```
