Client side

OpenBillingMenu

-- An export to open the billing menu.
exports["tgg-billing"]:OpenBillingMenu()

CloseBillingMenu

-- An export to close the billing menu.
exports["tgg-billing"]:CloseBillingMenu()

ToggleAvailability

---An export to enable/disable the billing menu.
---@param disabled boolean
exports["tgg-billing"]:ToggleAvailability(disabled)

PayInvoice

---An export to pay invoice manually.
---@param invoiceId number
---@return boolean
local success, amountPaid = exports["tgg-billing"]:PayInvoice(invoiceId)

CreateInvoice

local invoiceData = {
    items = {
       {
            key = "speeding",
            label = "Speeding",
            price = 100,
            quantity = 1,
            priceChange = false,
            quantityChange = false
        }
    },
    total = 100,
    notes = "Your notes here", -- Optional
    sender = "Your society here", -- Your society job identifier e.g. 'police' or '__personal'
    senderId = "Your sender Id", -- Usually this is the player's identifier
    senderName = "Your sender name", -- Usually this is the player's name
    recipientId = "The recipient Id", -- The recipient's identifier
    recipientName = "The recipient name", -- The recipient's name
    taxPercentage = 10,
    senderCompanyName = "Your society name", -- If sender is '__personal' might be nil
}

---An export to create an invoice manually.
---@param invoiceData table
---@return table The created invoice
local invoice = exports["tgg-billing"]:CreateInvoice(invoiceData)

Last updated