Files
red-valley/resources/[framework]/[addons]/qs-smartphone-pro/server/custom/billing/codemv2.lua
2026-03-29 21:41:17 +03:00

27 lines
636 B
Lua

if Config.Billing ~= 'codemv2' then return end
---@param source number
---@return Invoice[]
function GetInvoices(source)
local src = source
local bills = exports['codem-billingv2']:GetPlayerUnpaidBillings(src)
local data = {}
if bills then
for _, v in pairs(bills) do
table.insert(data, {
id = v.invoiceid,
price = v.amount,
label = v.reason,
})
end
end
return data
end
RegisterNetEvent('codemBilling:PayInvoice', function(invoiceId)
local src = source
exports['codem-billingv2']:PayBilling(src, invoiceId)
end)