completePurchase method

  1. @override
Future<void> completePurchase({
  1. required PurchaseDetails purchaseDetail,
  2. OnError? onError,
})
override

Implementation

@override
Future<void> completePurchase({
  required PurchaseDetails purchaseDetail,
  OnError? onError,
}) async {
  try {
    await _clearIOSPendingPurchases();
    await _inAppPurchase.completePurchase(purchaseDetail);
  } on InAppPurchaseException catch (x) {
    log('CompletePurchaseException(${x.code}, ${x.message}, ${x.source})');
    onError?.call(x.message.toString());
  }
}