payments
Info
ISPs (In-Script Purchasables) can be created after you upload a script via Forum's workshop.
restore
restore(callback: (res))
Retrieves all purchased ISPs and executes the callback with an array of them.
Parameters
Name | Type | Description |
---|---|---|
callback |
function(res: table[string]) | Callback |
Usage
payments.restore(function (res)
for k, v in ipairs(res) do
print(v);
end
end);
create
create(id: string, callback: (res))
Creates a new payment intent.
Note
While script is not loaded from workshop, payment window will always display the Test Item
and the result will be always positive.
Parameters
Name | Type | Description |
---|---|---|
id |
string | ISP's ID |
callback |
function(res: bool) | Result callback |
Usage
payments.create('my-id', function (res)
if res then
gui.show_message('my_message_id', 'Hey!', 'Payment was successful!');
end
end);