PlaytoliaStore.BeginPurchaseFlow("gold_500", onSuccess: (receipt) => { Debug.Log($"Purchase succeeded! Transaction: {receipt.ReceiptId}"); Debug.Log($"Store: {receipt.Store}"); Debug.Log($"Item: {receipt.Item.Name} ({receipt.Item.Sku})"); }, onError: (error) => { Debug.LogError($"Purchase failed [{error.Code}]: {error.Message}"); if (error.Code == "USER_CANCELLED") { // User backed out — no action needed return; } if (error.Stage == "ACKNOWLEDGEMENT") { // Player was charged, SDK will retry automatically ShowMessage("Your purchase is being processed."); return; } ShowMessage("Purchase failed: " + error.Message); });// Also accepts a StoreItem directlyvar item = PlaytoliaStore.GetItemById("gold_500");PlaytoliaStore.BeginPurchaseFlow(item, onSuccess: (receipt) => { /* grant confirmed */ }, onError: (error) => { /* handle error */ });
The onSuccess callback receives a PurchaseReceipt with the transaction ID, store, and purchased item. The onError callback receives a PurchaseError with a machine-readable error code, stage, and message. Both callbacks are optional.When the purchase completes successfully, the SDK automatically updates the player’s wallet, entitlements, and subscriptions.
Platform acknowledgement failed after verification
Store data is empty until the player is authenticated. All item getters return null or empty lists before login.
When Stage is ACKNOWLEDGEMENT, the user has been charged but acknowledgement failed. The SDK automatically retries on next app launch. Show a reassuring message like “Your purchase is being processed.”