WebGL SDK
Implement the Callbacks
To Implement the WebGL SDK, include the following callback methods:
Method | Description | Parameter | Type |
---|---|---|---|
OnInitialized | Triggered when checkout initialization is successful, after calling CheckoutController.Instance.Init(...) . | ||
OnInitializeFailed | Triggered when checkout initialization fails, after calling CheckoutController.Instance.Init(...) . | ||
OnPricePointsSuccess | Triggered when price points are successfully retrieved, after calling GetPricePoints . | pricePoints | |
OnPricePointsFail | Triggered when price points can’t be retrieved or are unavailable, after calling GetPricePoints . | error | |
OnPurchaseSuccess | Triggered when a purchase is successful. | order | |
OnPurchaseFailed | Triggered when the checkout window is closed or if an error occurs during the purchasing process, displaying an error message. | error |
Note: The interface includes three callback methods for purchase consumption, but their implementation is not relevant and therefore not applicable in this context.
Example code
Below is the example code for the implementation: