To launch the checkout, follow these steps:

  1. From your server, call the Create Checkout Session API to create a checkout session.

    Make this API call from your server to ensure session integrity and security. Never invoke this endpoint from your client-side code.

  2. After receiving the API response on your server, extract the relevant values and pass them to the openCheckout method 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.
    ACBridgeAPI.openCheckout(
        sessionToken: "SESSION_TOKEN",
        purchaseId: "SESSION_PURCHASE_ID",
        url: "CHECKOUT_URL"
    )
    
  3. Configure how the checkout page is displayed to meet regional compliance requirements:

    U.S. Compliance (External Browser)

    Set useExternalBrowser to true or YES for U.S. compliance when redirecting players to the web:

    ACBridgeAPI.useExternalBrowser = true
    

    European DMA (In-App Browser)

    Set useExternalBrowser to false or NO for European in-app payment compliance under the DMA:

    ACBridgeAPI.useExternalBrowser = false