Skip to content

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

ResourceRequiredNotes
twinded_libsYesFree shared library
twinded_lgw_societyNoEnables 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

bash
ensure twinded_libs
ensure twinded_lgw_billing

If using business invoices, also ensure twinded_lgw_society is started before this resource.

Config Files

FileDescription
settings.luaCommand, amounts, distance, exchange rate, webhook
lang.luaTranslation strings (all player-facing text)
webhook.luaCustom webhook handler (when Config.Webhook.type = 'custom')

See the Configuration guide for how to override these files.

Configuration Reference

settings.lua

OptionTypeDefaultDescription
Config.Commandstring"twinded_lgw_billing"Command to open the billing menu
Config.NearbyDistancenumber5.0Distance (meters) to detect nearby players for invoicing
Config.MinAmountnumber1.0Minimum invoice amount
Config.MaxAmountnumber50000.0Maximum invoice amount
Config.MaxReasonLengthnumber200Maximum characters for invoice reason
Config.ExchangeRatenumber2Dollar to Gold conversion rate
Config.Tablestring"twinded_lgw_billing"Database table name
Config.Webhook.typestring"discord"'discord' or 'custom'
Config.Webhook.urlstring""Discord webhook URL

webhook.lua — Custom Data Fields

When using Config.Webhook.type = 'custom', the data._meta object contains:

FieldTypeDescription
actionstringEvent type: "creation", "paiement", "refus", "suppression"
amountnumberInvoice amount
currencynumberCurrency type (0 = dollars, 1 = gold)
invoiceIdnumberInvoice database ID
issuerNamestringName of the invoice sender
targetNamestringName of the invoice recipient
billTypestring"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

CommandDescription
/twinded_lgw_billingOpen the billing menu (configurable in settings.lua)

Troubleshooting

ProblemSolution
Script doesn't startMake sure twinded_libs is started before
No business invoices optionEnsure twinded_lgw_society is started and your character has a society job
Can't find nearby playersCheck Config.NearbyDistance — players must be within range
Payment failsVerify the payer has sufficient funds in the correct currency
Table name conflictChange Config.Table in settings.lua

Premium RedM Scripts — Multi-Framework