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
OnAwardTriggered when the award action was either successful or failed. The award argument indicates whether the action was a success or a failure.successBool
OnNoneAwardedSuccessTriggered when the noneAwarded action was successful. The noneAwarded argument contains a list of orders to award.orderIds[String]
OnNoneAwardedFailedTriggered when the noneAwarded action failed.errorACErrorMessage
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 onAwarded(isAwarded: Boolean) {
        // Award success or fail
    }

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

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

    override fun onNoneAwardedSuccess(orderIds: List<String>) {
        // Handle none-awarded orders
    }

    override fun onNoneAwardedFailed(error: ErrorMessage) {
        // Handle none-awarded error code
    }
})