Accept Payments in iOS Games
With recent changes to Apple’s guidelines in some regions, game developers can now direct players to external websites to complete purchases. This article describes how to use Appcharge’s no-code payment links to offer a seamless checkout experience. Players can buy digital content such as bundles, coin packs, or skins through a secure and branded page outside your app.
Appcharge serves as your comprehensive Merchant of Record (MoR) partner, providing:
- Localized pricing
- Tax calculation and payment
- Fraud prevention and chargeback management
- No-code payment link generation
- Customizable checkout experiences
How it works
Step 1 | Create a checkout session
When a player selects an offer in your game, such as a coin pack or a character skin, your game requests a session from your game server. Your game server then sends a server-to server request to Appcharge's Create Checkout Session API. The request includes:
- Offer details: Offer name and ID, offer items, and images.
- Pricing: The amount the player will be charged
- Redirect URL: A deeplink URL for redirecting the player to your domain, bringing them back to the game. Learn how to redirect iOS players back to your game.
Appcharge then processes the request and returns the following checkout details. You'll need the checkoutSessionToken
and the url
to build the checkout page URL in the next step.
Parameter | Type | Description |
---|---|---|
checkoutSessionToken | String | A unique token that identifies and validates the checkout session. Use this token to authenticate or verify the transaction at later stages of the flow. |
purchaseId | String | A unique ID for the purchase. This can be used to track the transaction in your system or correlate with game-specific purchase logic. |
url | URL | The base URL for the checkout page hosted by Appcharge. |
Step 2 | Open the checkout
To initiate a web payment, build the checkout URL on your game server, using this format:
{$url}/{$checkoutSessionToken}?cot={$Checkout_Public_Key}
Your checkout URL should look something like this:
https://appcharge-checkout-url.com/eb02bb412ccb47948f7d62667a7774b1?cot=0b2b42ab8a3d491ba76b6b8919d8e0ee
You can find the Checkout Public Key in the Publisher Dashboard under Settings > Integration > Checkout Public Key.
Once you've constructed the URL, use it to open the checkout from your game. Note: Present this web payment as a separate option so players understand when they're leaving the app, ensuring compliance with transparency rules. The player will be taken to a secure payment page hosted by Appcharge, where they can complete the purchase.
Step 3 | Player completes the payment
The player selects a payment method and confirms the purchase. Once payment is finalized, Appcharge processes the transaction securely in the background and sends the entire payment information to your servers via the Player Order Reporting Webhook.
Step 4 | Post-payment redirect
If you specified a redirect URL in the Create Checkout Session API, the player will be redirected to it after a successful payment, usually back to your game.
The redirect link contains one of the following payment statuses:
Status | Meaning |
---|---|
?status=success | The purchase was completed successfully. |
?status=fail | An error occurred during the purchase process, and the user closed the checkout. |
?status=cancel | The player actively canceled the purchase. |
You'll then need to handle the purchase result inside your game based on the payment status. Once the transaction is verified with your game server, you can grant the purchased items to the player.
Note: The redirect URL uses a Universal Link, which triggers a confirmation dialog asking players if they want to open the app. Learn how to remove the iOS confirmation prompt and send players straight back into the game.
Example
We've created a sample Unity app flow that guides you through the recommended process for integrating Appcharge Payment Links into an iOS game.
Customize your checkout
Use the Appcharge builder to customize your checkout page and receipts. With the Appcharge Publisher Dashboard, you can fully customize your checkout experience. You can change colors, fonts, text, and the available payment methods for each country. You can also personalize customer receipts by adding your logo, images, and other brand elements.
Mobile Measurement Partner (MMP) integration
If you're using a Mobile Measurement Partner (MMP) like AppsFlyer, you can continue to track player purchases and lifetime value (LTV) even when using Appcharge’s web-based checkout.
How it works:
- A player completes a purchase via an Appcharge-hosted checkout page.
- Appcharge confirms the successful transaction to your backend, and passes all the relevant parameters for your AppsFlyer SDK integration
- Your game server then forwards the purchase event to the AppsFlyer SDK, just as it would for in-app purchases.
This ensures that player revenue and LTV tracking in AppsFlyer remains uninterrupted, even when the transaction happens outside the app.
Updated 13 days ago