Link Out vs Payment Links SDK
| Capability | Link Out (API Only) | Payment Links SDK |
|---|---|---|
| Checkout launch | The app opens parsedUrl in a browser. | The app passes purchaseId and parsedUrl to the SDK, and the SDK opens checkout. |
| Return URL setup | redirectUrl is required when creating a checkout session. | SDK configuration defines the return link. Don’t pass redirectUrl in the Create Checkout Session API request. |
| Redirect handling | The app receives the redirect URL and parses ?status=success, ?status=fail, or ?status=cancel. | The app passes incoming URLs to the SDK. The SDK completes transaction handling and triggers success or failure callbacks. |
| Success and failure callbacks | The app infers the result from the URL status parameter. | The SDK returns onPurchaseSuccess and onPurchaseFailed callbacks. |
| Purchase validation | The application backend validates against the Grant Award Callback before fulfillment. | No change. The application backend still validates against the Grant Award Callback before fulfillment. |
| Browser type awareness | N/A | The SDK handles internal and external flows. |
| Supported platforms | Any platform with manual implementation. | iOS, Android, Unity. |
| Maintenance | Managed by the application team. | Managed by Appcharge. |
purchaseId.
Migration process
Follow the SDK documentation for your platform to implement the SDK. Use the steps below to identify the Link Out-specific changes you need to make during that implementation. For the full end-to-end SDK implementation, see the Payment Links SDK flow.Step 1 | Implement and configure the SDK
First, import, configure, and initialize the Payment Links SDK for your platform. During setup, move your return handling from the Link OutredirectUrl API field into the SDK configuration.
If your Link Out flow already uses a universal link for iOS, you can use the same universal link in the SDK configuration.
If your Link Out flow uses a deep link for Android, you need to update the deep link scheme in the SDK configuration.
Native iOS SDK setup
Native iOS SDK setup
Complete these SDK pages:During setup, add the URL scheme
acnative-$(PRODUCT_BUNDLE_IDENTIFIER), set the associated domain to your Link Out universal link domain using applinks:{YOUR_DOMAIN}, and pass the universal link you created in the Link Out flow as redirectUrl in the iOS SDK ConfigModel.Native Android SDK setup
Native Android SDK setup
Complete these SDK pages:During setup, add the SDK checkout activity to your manifest and add the deep link scheme
<data android:scheme="acnative-{IDENTIFIER}"/>. Replace {IDENTIFIER} with the last sequence of your package name, as described in the Android setup guide.Reuse your existing Link Out app link handling, but set the SDK return scheme to acnative-{IDENTIFIER}. If your existing scheme is different, add the SDK scheme and pass incoming URLs to the SDK.Unity SDK setup
Unity SDK setup
Complete these SDK pages:
- Import the Unity SDK.
- Configure the SDK.
- Initialize the SDK.
- For iOS builds, Integrate with iOS.
- For Android builds, Integrate with Android.
Step 2 | Remove redirectUrl from checkout session requests
In the non-SDK flow, you passed redirectUrl in the body of the Create Checkout Session API request. The browser used this URL to redirect the player back to your app after payment.
With the SDK, the player is redirected using the link configured in your SDK setup file, so you must remove the redirectUrl parameter from your API request.
purchaseId and parsedUrl. In the next step, you’ll use the parsedUrl to launch the checkout.
Step 3 | Open checkout through the SDK
The checkout session response still includes values such aspurchaseId and parsedUrl. Return the session response to your client, then pass those values to the SDK instead of opening parsedUrl directly in a browser:
- Native iOS: Call
ACBridgeAPI.openCheckout(purchaseId, parsedUrl). See Launch the Checkout. - Native Android: Call
BridgeAPI.openCheckout(purchaseId, parsedUrl). See Launch the Checkout. - Unity: Call
PaymentLinksController.Instance.OpenCheckout(purchaseId, parsedUrl). See Launch the Checkout.
The session response values must be passed exactly as received. Modifying
purchaseId, parsedUrl, or other session values may cause checkout to fail.Step 4 | Replace URL status parsing with SDK callbacks
Remove client code that parses the returned URL for?status=success, ?status=fail, or ?status=cancel. After the player returns to your app through the SDK-configured return link, pass the incoming URL to the SDK and handle the SDK callbacks instead:
- Native iOS: Implement the Callbacks.
- Native Android: Implement the Callbacks.
- Unity: Implement the Callbacks.
| Native callback | Unity callback | When it fires |
|---|---|---|
onPurchaseSuccess | OnPurchaseSuccess | Purchase completed successfully. |
onPurchaseFailed | OnPurchaseFailed | Checkout was closed, canceled, failed, or a server-to-server error occurred during purchase handling. |
onPurchaseSuccess or OnPurchaseSuccess fires, use the returned OrderResponseModel to identify the purchase. The model includes purchaseId, orderId, customerId, purchased items, price, currency, and related order data.
The purchaseId is a lookup key, not proof of payment, so you must validate the purchase with the game server before fulfillment. The application backend should match the purchase against the Grant Award Callback data before granting items to the player.
Step 5 | Test the migrated flow
Before you move to production, test the full purchase flow in your sandbox environment:- Create a checkout session from the game server without
redirectUrl. - Open checkout through the SDK.
- Complete a successful purchase and verify that the success callback fires.
- Close or cancel checkout and verify that the failure callback fires.
- Confirm the application backend receives the Grant Award Callback.
- Confirm the application backend validates and fulfills only valid purchases.
- Test player return behavior for internal and external browser modes that your app supports.
Migration checklist
- Import and configure the SDK for your platform.
- Configure the deep link/universal link in the SDK config file:
- iOS: uses a .plist file.
- Android: uses a manifest file.
- Unity: uses an Appcharge config file.
- Initialize the SDK in your app.
- Implement callback methods, including
onPurchaseSuccessandonPurchaseFailed. - Remove
redirectUrlfrom the Create Checkout Session API call. - Configure your app to pass incoming URLs to the SDK.
- Remove manual URL status parsing from the game client.
- Test the full purchase flow in a sandbox environment.
Related articles
Payment Link Flow (SDK)
Review the full Payment Links SDK integration flow.
iOS SDK Setup
Import and configure the Payment Links SDK for native iOS.
Android SDK Setup
Set up and configure the Payment Links SDK for native Android.
Unity SDK Setup
Import and configure the Payment Links SDK for Unity.
Troubleshooting
Resolve common issues with Payment Links SDK integrations.
Grant Award Callback
Review the callback used to validate and fulfill completed purchases.
