Skip to main content
To implement the Android Payment Links SDK, include the following callback methods:
MethodDescriptionArgumentType
OnInitializedTriggered when SDK initialization was successful.
OnInitializeFailedTriggered when SDK initialization failed.errorErrorMessage
OnPricePointsSuccessTriggered when price points are successfully retrieved, after calling GetPricePoints.pricePointsPricePointsModel
OnPricePointsFailTriggered when price points can’t be retrieved or are unavailable, after calling GetPricePoints.errorErrorMessage
OnPurchaseSuccessTriggered when a purchase was successful.orderOrderResponseModel
OnPurchaseFailedTriggered when the checkout window closed or if a server-to-server error occurred during the purchasing process. Returns an error code, message, and JSON.errorErrorMessage
The OrderResponseModel argument type contains the following properties:
Property NameTypeDescriptionExample
dateIntUnix timestamp of the order.1718182312
sessionTokenStringUnique token for the current session."xxxxXXXXxxxxXXXXxxxx"
offerNameStringName of the purchased offer."Starter Pack"
offerSkuStringSKU identifier for the offer."starter_pack_001"
items[Item]List of items included in the purchase.[{ name: "Gems", sku: "gem_01", quantity: "100" }]
items.nameStringDisplay name of the item."Gems"
items.skuStringUnique SKU code for the item."gem_01"
items.quantityStringQuantity of the item included."100"
priceIntPrice of the order in minor units. For example, cents for USD.499
currencyStringISO 4217 currency code"USD"
customerIdStringID of the player who made the purchase."cust_98765"
customerCountryStringCountry code of the player in ISO 3166-1 alpha-2 format."US"
paymentMethodNameStringPayment method."Visa"
orderIdStringOrder ID."1234567890"
purchaseIdStringA unique ID to track the transaction."pr_xxxxxx"

Example code

BridgeAPI.init(context, configModel, customerId, object : ICheckoutPurchase {
    override fun onInitialized() {
        // Handle initialization success
    }

    override fun onInitializeFailed(error: ErrorMessage) {
        // Handle initialization fail
    }

    override fun onPurchaseSuccess(order: OrderResponseModel) {
        // Handle purchase success
    }

    override fun onPurchaseFailed(error: ErrorMessage) {
        // Handle purchase failure
    }

    override fun onPricePointsSuccess(pricePoints: PricePointsModel) {
        // Handle price points
    }

    override fun onPricePointsFail(error: ErrorMessage) {
        // Handle price points error code
    }
})