CrazyGames have partnered with Xsolla to offer you the possibility to integrate in-game purchases more conveniently. Learn more about how to use Xsolla on the CrazyGames developer pages.
If you would like to use Xsolla via CrazyGames’ custom-generated token, you can retrieve the Xsolla token like this:
crazygames.get_xsolla_user_token(function(self, token)
print(token)
end)
CrazyGames recommend that you retrieve the token every time before using it, since the tokens are usually short-lived, for example only 1 hour. The SDK handles the token refresh.
CrazyGames order tracking is optional. After Xsolla reports that an order has completed, pass the order object to the analytics API:
crazygames.track_order("xsolla", {
orderId = "example-order-id",
status = "done",
})
The order table must be JSON-serializable. CrazyGames also encourages reporting new and canceled orders when those states are available.
Did you spot an error or do you have a suggestion? Please let us know on GitHub!
GITHUB