Billing Systems
ActivityManager supports automatic invoice synchronization with many popular billing systems.
Supported Billing Systems
esx_billingESX Default Billing
okokBillingOkok Billing
qs-billingQuasar Billing
brutal_billingBrutal Billing
ars_billingArius Billing
g-billingG-Billing (QBCore)
randol_billingRandol Billing
codem-billingCodem Billing v2
s1n_billingS1N Billing
RxBillingRX Billing
Basic Configuration
Config.Billing = {
enabled = true,
system = 'okokBilling', -- Change to your billing system
tableName = 'okokbanking_transactions', -- Your billing DB table
syncToAPI = true, -- Sync to ActivityManager Discord bot
showNotifications = true,
validateAmount = true,
minAmount = 1,
maxAmount = 999999999,
monitorDatabase = true,
monitorInterval = 30000, -- Check DB every 30 seconds
debugMode = false
}How It Works
- Event Interception: ActivityManager listens to billing system events.
- Data Extraction: Invoice amount, label, sender, and recipient are captured.
- API Sync: Data is sent to the ActivityManager API.
- Discord Update: The Discord bot updates employee invoice stats.
Intercepted Events
Each billing system uses different events. Here are some examples:
-- ESX Billing
'esx_billing:sendBill'
'esx_billing:sendBillToIdentifier'
-- Okok Billing
'okokBilling:SendBill'
'okokBilling:CreateBill'
-- Quasar Billing
'qs-billing:createBill'
-- And more... (see sv_billing.lua for full list)Adding Custom Billing System
The sv_billing.lua file is not encrypted and can be modified to add support for additional billing systems.
-- Example: Adding a custom billing system
RegisterNetEvent('myCustomBilling:sendInvoice')
AddEventHandler('myCustomBilling:sendInvoice', function(targetId, amount, label)
local src = source
SyncToActivityManager({
source = src,
targetId = targetId,
amount = tonumber(amount) or 0,
label = label or 'Invoice',
billingSystem = 'myCustomBilling'
})
end)Database Monitoring
For billing systems that don't fire events (or for external invoices), ActivityManager can monitor your database directly:
Config.Billing = {
monitorDatabase = true,
monitorInterval = 30000, -- Check every 30 seconds
tableName = 'your_billing_table'
}Troubleshooting
Invoices not syncing?
- Enable
debugMode = truein Config.Billing - Check server console for billing intercept messages
- Verify your billing system name matches exactly
- Ensure the player has an active shift in the correct zone
API Connection Failed?
- Verify your server IP is whitelisted
- Check that the guild is linked in
activitymanager_guilds - Ensure the ActivityManager bot is in your Discord server
