Server side

PayInvoice

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

CancelInvoice

---An export to cancel invoice manually.
---@param source number
---@param invoiceId number
---@return boolean
local success = exports["tgg-billing"]:CancelInvoice(source, 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