After creating the configuration object, we can now initialize the checkout as follows:
CheckoutController.Instance.Init(callback);
Argument | Description |
---|---|
callback | A callback interface implementation: ICheckoutPurchase |
The ICheckoutPurchase
interface acts as a callback. The methods within the interface will be triggered based on the following events:
Method | Description | Arguments |
---|---|---|
OnInitialized | Triggered when the checkout initialization is completed. | |
OnInitializeFailed | Triggered when initialization has failed. | ErrorMessage containing a code and reason for the failure. |
OnPurchaseSuccess | Triggered when the purchase is completed successfully. | OrderResponseModel containing detailed properties for the order. |
OnPurchaseFailed | Triggered when the purchase fails for any reason. | ErrorMessage containing a code and reason for the failure. |
OnPurchaseConsumed | Triggered when the purchase is consumed by the client. | true if the purchase is consumed successfully, or false otherwise. |
OnPricePointsSuccess | Triggered when price points are successfully retrieved. | PricePointsModel containing details about the price points. |
OnPricePointsFail | Triggered when price points are not retrieved properly. | ErrorMessage containing a code and reason for the failure. |
OnGetNonConsumeOrdersSuccess | Triggered when none-consumed operation was success. | Message will contain a List of order IDs that are waiting for being consumed. |
OnGetNonConsumeOrdersFail | Triggered when none-consumed operation failed to execute. | ErrorMessage containing a code and reason for the failure. |