twinded_lgw_billing
A comprehensive invoicing and billing system for RedM. Send personal, business-to-player, and business-to-business invoices with multi-currency support (Dollars & Gold), automatic payment processing, and Discord webhook logging.
Dependencies
| Resource | Required | Notes |
|---|---|---|
| twinded_libs | Yes | Free shared library |
| twinded_lgw_society | No | Enables business invoices (B2P and B2B) |
Compatibility
Cross-framework — works with VORP, RSG, QBCore RedM, QRCore, RedEM:RP, RPX, TPZ-CORE, and FRP. Framework is auto-detected by twinded_libs. Database table is created automatically on first start.
Offline Payments
Offline credit (paying an offline player) uses a direct SQL update on the characters table. This is compatible with VORP by default. Other frameworks may require adjustments.
Installation
ensure twinded_libs
ensure twinded_lgw_billingIf using business invoices, also ensure twinded_lgw_society is started before this resource.
Config Files
| File | Description |
|---|---|
settings.lua | Command, amounts, distance, exchange rate, webhook |
lang.lua | Translation strings (all player-facing text) |
webhook.lua | Custom webhook handler (when Config.Webhook.type = 'custom') |
See the Configuration guide for how to override these files.
Configuration Reference
settings.lua
| Option | Type | Default | Description |
|---|---|---|---|
Config.Command | string | "twinded_lgw_billing" | Command to open the billing menu |
Config.NearbyDistance | number | 5.0 | Distance (meters) to detect nearby players for invoicing |
Config.MinAmount | number | 1.0 | Minimum invoice amount |
Config.MaxAmount | number | 50000.0 | Maximum invoice amount |
Config.MaxReasonLength | number | 200 | Maximum characters for invoice reason |
Config.ExchangeRate | number | 2 | Dollar to Gold conversion rate |
Config.Table | string | "twinded_lgw_billing" | Database table name |
Config.Webhook.type | string | "discord" | 'discord' or 'custom' |
Config.Webhook.url | string | "" | Discord webhook URL |
webhook.lua — Custom Data Fields
When using Config.Webhook.type = 'custom', the data._meta object contains:
| Field | Type | Description |
|---|---|---|
action | string | Event type: "creation", "paiement", "refus", "suppression" |
amount | number | Invoice amount |
currency | number | Currency type (0 = dollars, 1 = gold) |
invoiceId | number | Invoice database ID |
issuerName | string | Name of the invoice sender |
targetName | string | Name of the invoice recipient |
billType | string | "personal", "business_to_player", or "business_to_business" |
Features
- Personal invoices — Send invoices in your own name, choose dollars or gold
- Business-to-Player (B2P) — Invoice a player on behalf of your company
- Business-to-Business (B2B) — Invoice another company's treasury
- Dual currency — Dollars ($) and Gold with automatic conversion
- Society integration — Optional twinded_lgw_society add-on (works standalone for personal invoices)
- Offline payments — Issuer receives funds even if offline (direct DB update)
- Invoice management — View, pay, refuse, or delete invoices
- Self-billing protection — Cannot invoice yourself or your own company
- Auto-migration — Database table created automatically on startup
- Rate limiting — Anti-spam cooldown
- Webhook logging — Discord or custom handler
Command
| Command | Description |
|---|---|
/twinded_lgw_billing | Open the billing menu (configurable in settings.lua) |
Troubleshooting
| Problem | Solution |
|---|---|
| Script doesn't start | Make sure twinded_libs is started before |
| No business invoices option | Ensure twinded_lgw_society is started and your character has a society job |
| Can't find nearby players | Check Config.NearbyDistance — players must be within range |
| Payment fails | Verify the payer has sufficient funds in the correct currency |
| Table name conflict | Change Config.Table in settings.lua |

