customerId
. This allows the SDK to handle cases where the player closes the browser during checkout and later returns to the game. In such cases, the SDK begins validating the order using the customerId
from initialization and the purchaseId
from the checkout session. It then contacts the Appcharge server to check the order status and responds to the app with the next step.
Additionally, the customerId
ensures correct validation even if multiple players share the same device. For example, if a different player logs into the same game on the same phone, the SDK uses the customerId
to identify the correct player and validate any associated orders with the Appcharge server.
Use the following function to initialize the SDK:
Argument | Type | Description |
---|---|---|
Customer ID | string | Customer ID. |
Callback | ICheckoutPurchase | Interface callback. |
environment
or customerId
in real-time.
Argument | Type | Description |
---|---|---|
Checkout Public Key | string | The checkout public key, located in the Publisher Dashboard. In the sidebar menu, click Settings, then select the Integration tab. Copy the Checkout Public Key value. |
Environment | string | The checkout environment. One of: - sandbox : For testing.- production : For live operations. |
Customer ID | string | Customer ID. |
Callback | ICheckoutPurchase | Interface callback. |