finishTransaction

Complete a purchase transaction. Must be called after verifying the purchase to remove it from the queue.

iOS: Calls Transaction.finish(). Until you do, the same transaction replays through Transaction.updates on every app launch. Apple docs. Android: Acknowledges (acknowledgePurchase) for non-consumables/subscriptions or consumes (consumeAsync) for consumables. Google auto-refunds within 3 days if neither runs. Google docs.

Signature

swift
func finishTransaction(purchase: PurchaseInput, isConsumable: Bool?) async throws

Parameters#

The transaction to close, plus an optional consumable flag:

  • purchase (required, Purchase) — The purchase / transaction to finalize. Must come from requestPurchase or getAvailablePurchases.
  • isConsumable (optional, boolean, default false) Android. true consumes the token (re-buyable like coins); false just acknowledges (non-consumables, subscriptions). iOS always calls Transaction.finish() regardless.

Returns#

Promise<void> — Resolves once the platform finalizes the transaction.

Throws#

When the platform finalize call fails.

Example

swift
try await OpenIapModule.shared.finishTransaction(
    purchase: purchase,
    isConsumable: false
)