OrigenNetwork
Docs

Custom · origen_billing

The custom/ folder is the single integration point between origen_billing and the rest of your server. It is fully in escrow_ignore — edit freely without touching protected core files.

text
custom/
├── server.lua          ← framework + money + permissions adapters
└── bridge/
    └── banking/
        └── server.lua  ← banking provider override (if Config.BankingProvider = 'custom')

custom/server.lua

Custom.isPlayerStaff(src) → boolean

Determines whether a player can access the billing admin panel (/billingadmin).

The check runs in priority order:

  1. Framework admin check (QBCore/QBox HasPermission)
  2. FiveM ACE group fallback — checks each group listed in Config.GroupPermissions
  3. ACE 'command' wildcard
lua
-- Groups that grant admin access (ACE fallback)
Config.GroupPermissions = { 'god', 'admin', 'superadmin' }

To add a custom check (e.g. a citizenid whitelist), add it before return false inside the function.


Custom.isJobBoss(src, jobName) → boolean

Called from each job's isBoss function in Config.AuthorizedJobs. Returns true if the player is the boss of the given job.

Default implementation checks Player.PlayerData.job.isboss. Alternative examples:

lua
-- By grade level
return Player.PlayerData.job.grade.level >= 3
 
-- ESX
local xPlayer = ESX.GetPlayerFromId(src)
return xPlayer and xPlayer.job.grade_name == 'boss'

Custom.getIdentifier(source) → string

Returns the player's unique identifier (citizenid). Delegates to Framework.GetPlayerIdentifier.


Custom.getFullName(source) → string

Returns the player's full display name ("Firstname Lastname").


Custom.getJobData(source) → table

Returns the player's current job data. Shape: { jobName, isBoss, ... } (framework-dependent).


Custom.getBankBalance(source) → number

Returns the player's current bank balance.


Custom.removeBankMoney(source, amount, reason) → boolean

Deducts amount from the player's bank account.


Custom.addBankMoney(source, amount, reason) → boolean

Deposits amount into the player's bank account (used for commission payouts).


Custom.getCashBalance(source) → number

Returns the player's current cash balance.


Custom.removeCashMoney(source, amount, reason) → boolean

Deducts amount from the player's cash.


Custom.addSocietyMoney(account, amount, reason) → boolean

Deposits amount into a society bank account. The account string maps to the societyAccount field of the job config.


Custom.getSourceByIdentifier(citizenid) → number|nil

Returns the server source of an online player by their citizenid, or nil if they are offline. Used to send real-time notifications when an invoice is created.


custom/bridge/banking/server.lua

Only used when Config.BankingProvider = 'custom'. Implement the Banking table with AddAccountMoney to support a banking resource not included in the built-in bridge.

lua
Banking = {}
 
function Banking.AddAccountMoney(account, amount, reason)
    -- your custom implementation
end