Skip to main content
To launch the checkout, follow these steps:
  1. From your server, call the Create Checkout Session API to create a checkout session.
    • When calling the Create Checkout Session API, don’t pass the redirectUrl parameter, as the SDK already handles the redirect automatically using the configuration file.
    • Call the API from your server to ensure session integrity and security. Never invoke this endpoint from your client-side Unity Project.
  2. After receiving the API response on your server, extract the relevant values and pass them to the OpenCheckout function on the client:
    ParameterDescription
    checkoutSessionTokenA unique token to identify and validate the checkout session.
    purchaseIdID to track the purchase.
    urlThe base URL of the Appcharge checkout page.
    PaymentLinksController.Instance.OpenCheckout(
        sessionToken: "SESSION_TOKEN",
        purchaseId: "SESSION_PURCHASE_ID",
        url: "CHECKOUT_URL"
    )
    

Checkout presentation

You can manually override the following configuration settings at runtime by updating them programmatically. To control how the browser is opened:
  • External browser
    Open the checkout in the device’s default browser. This flow will redirect the player back to the app.
    PaymentLinksController.Instance.SetConfiguration("useInternalBrowser", "false")
    
    Running the checkout in an external browser may cause inconsistent behavior across devices, incomplete transactions, or app unexpected lifecycle behavior.
  • Non-external browser (default)
    The checkout opens in the device’s internal browser or SFSafariViewController. This flow will use the URL scheme provided in the configuration file to return back to the app. For more information, see Sell Outside IAP.
    PaymentLinksController.Instance.SetConfiguration("useInternalBrowser", "true")
    
To control the browser orientation:
  • Use current layout (default)
    The checkout uses the current application orientation.
    PaymentLinksController.Instance.SetConfiguration("portraitOrientationLock", "false")
    
  • Portrait Lock mode
    Lock the orientation to portrait whenever the checkout launches, even if the application is in landscape mode.
    PaymentLinksController.Instance.SetConfiguration("portraitOrientationLock", "true")