To implement the iOS Mobile Checkout SDK, include the following callback methods:

MethodDescriptionArgumentType
onInitializedTriggered when SDK initialization was successful.
onInitializeFailedTriggered when SDK initialization failed.
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 a unique integer error code, a detailed message, and a raw JSON string (if available) with more details.errorACErrorMessage

The OrderResponseModel argument 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 customer who made the purchase."cust_98765"
customerCountryStringCountry code of the customer 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

extension ViewController: ACCheckoutPurchaseDelegate {
    func onInitialized() {
        print("SDK initialization was successful.")
    }
    func onInitializeFailed(error: ACErrorMessage) {
        print("SDK initialization failed: \(error)")
    }
    func onPurchaseSuccess(order: OrderResponseModel) {
        print("Purchase was successful: \(order.orderId ?? "No order ID found.")")
    }
    func onPurchaseFailed(error: ACErrorMessage) {
        print("Purchase failed: \(error)")
    }
}