finishTransaction method

Future<void> finishTransaction(
  1. SKPaymentTransactionWrapper transaction
)

Finishes a transaction and removes it from the queue.

This method should be called after the given transaction has been succesfully processed and its content has been delivered to the user. Transaction status updates are propagated to SkTransactionObserver.

This will throw a Platform exception if transaction.transactionState is SKPaymentTransactionStateWrapper.purchasing.

This method calls StoreKit's -[SKPaymentQueue finishTransaction:].

Implementation

Future<void> finishTransaction(
    SKPaymentTransactionWrapper transaction) async {
  Map<String, String?> requestMap = transaction.toFinishMap();
  await channel.invokeMethod<void>(
    '-[InAppPurchasePlugin finishTransaction:result:]',
    requestMap,
  );
}