AppchargeCheckout component supports the following optional frontend event function properties:
| Event | Description |
|---|---|
onClose | Triggered when the checkout modal is closed using the X, Back to Store, or Back to Game buttons. |
onOrderCreated | Triggered when an order is created. |
onOrderCompletedFailed | Triggered when an order fails due to an internal error or publisher reward error. An error object is present for fatal failures, such as when there’s an issue with the Grant Award Callback, for example, an invalid link. |
onOrderCompletedSuccessfully | Triggered when an order is updated with the publisher and confirmation is received. |
onPaymentIntent | Triggered when the player clicks Pay. |
onPaymentIntentFailed | Triggered when the player clicks Pay and the payment fails, or when the checkout session fails to open. An error object is present for fatal failures, such as when the session fails to open. |
onPaymentIntentSuccess | Triggered when the player clicks Pay and the payment is charged successfully. |
Event parameters
Below are the parameters that you can pass to the event functions. Not all parameters are available for every event, and ones that are unavailable will beundefined.
| Name | Description | Event Name |
|---|---|---|
orderId | Order ID. | All |
date | Epoch timestamp. | All |
bundleId | Bundle ID. | All |
bundleName | Bundle name. | All |
bundleSKU | Stock Keeping Unit (SKU) for the bundle. | All |
products[] | An array of products included in the order. | All |
sessionId | Identifier for the session associated with the order. | All |
totalSum | The total sum of the order. | All |
totalSumCurrency | Currency of the total sum. | All |
userCountry | The country associated with the player. | All |
userId | Player ID. | All |
promoCode | Promo code applied to the order. Returned only when a coupon was used. | All |
reason | Reason for the failure or additional notes. | onPaymentIntentFailed onOrderCompletedFailed |
error | Information about the error. | onPaymentIntentFailed onOrderCompletedFailed |
error.code | Error code. See Troubleshooting for a list of error codes. | onPaymentIntentFailed onOrderCompletedFailed |
error.isFatal | Whether the error is fatal. Always true when error is present. | onPaymentIntentFailed onOrderCompletedFailed |
error.reason | Reason for the error. | onPaymentIntentFailed onOrderCompletedFailed |
paymentMethodName | Name of the payment method used for the order. | onPaymentIntentSuccess onOrderCompletedSuccessfully onPaymentIntent onPaymentIntentFailed onOrderCompletedFailed |
isSavedPaymentMethodUsed | Whether the player used or attempted to use a saved card (card on file) during checkout. | onPaymentIntentSuccess onOrderCompletedSuccessfully onPaymentIntent onPaymentIntentFailed onOrderCompletedFailed |
isNewPaymentMethodSaved | Whether the player saved or attempted to save a new card during checkout. | onPaymentIntentSuccess onOrderCompletedSuccessfully onPaymentIntent onPaymentIntentFailed onOrderCompletedFailed |
