completePurchase method

Future<void> completePurchase(
  1. PurchaseDetails purchase
)

Mark that purchased content has been delivered to the user.

You are responsible for completing every PurchaseDetails whose PurchaseDetails.status is PurchaseStatus.purchased or PurchaseStatus.restored. Completing a PurchaseStatus.pending purchase will cause an exception. For convenience, PurchaseDetails.pendingCompletePurchase indicates if a purchase is pending for completion.

The method will throw a PurchaseException when the purchase could not be finished. Depending on the PurchaseException.errorCode the developer should try to complete the purchase via this method again, or retry the completePurchase method at a later time. If the PurchaseException.errorCode indicates you should not retry there might be some issue with the app's code or the configuration of the app in the respective store. The developer is responsible to fix this issue. The PurchaseException.message field might provide more information on what went wrong.

Implementation

Future<void> completePurchase(PurchaseDetails purchase) =>
    throw UnimplementedError('completePurchase() has not been implemented.');