Payment Link Flow
This article explains how to use the iOS Mobile Checkout SDK to implement the iOS Payment Link feature. It walks through the full integration flow, from starting a checkout session to handling callbacks and completing the purchase.
Step 1 | Create a server-to-server checkout session
When a player selects an offer in your game, such as a coin pack or a character skin, send the item details from the game client to your game server. From your server, call the Create Checkout Session API to create a checkout session.
Step 2 | Use the SDK to open the checkout page
Implement the SDK to launch the Appcharge checkout page.
Step 3 | Receive the payment notification event if relevant
The player selects a payment method and completes the purchase. The Player Order Reporting Webhook is then triggered, and your game server receives a POST request with full transaction data.
If the player doesn’t complete the purchase, the checkout session will automatically expire after 1 hour or when the player actively closes the checkout page. To cancel an open checkout session at any time, such as when multiple checkout tabs are open, call the Cancel Checkout Session API.
You can listen for order events that are triggered based on different checkout outcomes.
Step 4 | Redirect the player back to your app
After a player completes a purchase or exits the checkout, they’ll be redirected back to your app via a Universal Link or deeplink. This behavior is configured during SDK setup. Your app must capture this URL and forward it to the SDK to finalize the transaction.
Step 5 | Handle success & failure callbacks
Appcharge receives the URL, validates the transaction against the webhook data, and dispatches a success or failure event.
Step 6 | Validate the purchase with your server
If the purchase is successful, the onPurchaseSuccess
(Native iOS) or OnPurchaseSuccess
(Unity iOS) callback is triggered with an OrderResponseModel
argument containing the purchaseId
. You can use this to validate the purchase with your game server.
The purchaseId
also serves as the identifier for the transaction, allowing you to track the purchase and retrieve the offer item details associated with it. Once validated, fulfill the order by granting the purchased items to the player’s account.