Launching Checkout

Setup The Product

In this step, create the product and set up its name, price, and additional information:

val model = SessionRequestModel(  
    "John Doe", // Customer ID - Mandatory  
    "[[email protected]](mailto:[email protected])", // Customer Email  
    129, // Price in cents - Mandatory  
    "usd", // Currency code - Mandatory  
    "BestDealPackage", // Offer name - Mandatory  
    "Best_deal_package", // Offer Sku - Mandatory  
    "", // Offer Asset URL  
    "Coin Pack Bundle" // Offer Description  
)  
model.addItem(  
    "Coins", // Name - Mandatory  
    "<https://media-dev.appcharge.com/media/product-3.png">, // Item image URL  
    "Coins_xoxoxo", // Item Description  
    300, // Quantity - Mandatory, At least one  
)

Open Checkout

In this final step, open the checkout by passing your product model to it:

bridge.openCheckout(model);

At runtime, a new window will open, guiding you through the purchase process. Based on user interaction, relevant interface methods will be triggered:

MethodDescription
OnPurchaseSuccessTriggered when the user completes the purchase
OnPurchaseFailedTriggered when the checkout window is closed or any error occur in the purchasing phase