Finishing a transaction
Finish the transaction to complete the purchase process.
Overview
Finishing a transaction tells StoreKit that your app completed its workflow to make a purchase complete. Unfinished transactions remain in the queue until they’re finished, so be sure to add the transaction queue observer every time your app launches, to enable your app to finish the transactions. Your app needs to finish each transaction, whether it succeeds or fails.
Do all of the following before you finish a transaction:
Persist the purchase.
Deliver, download, or unlock the purchased content.
Update your app’s UI so the user can access the product.
To finish the transaction, call the finishTransaction(_:) method on the payment queue.
After you finish a transaction, don’t take any actions on it or do any work to deliver the product. If any work remains, your app isn’t ready to finish the transaction.