As far as I know, the active listener task should finish the transaction.
Otherwise you have to setup a listener for Transaction.unfinished, found below:
https://developer.apple.com/documentation/storekit/transaction/unfinished
A transaction is unfinished until you call finish(). Use the unfinished sequence to find the transactions your app needs to process to deliver purchased content or enable service.
Topic:
App & System Services
SubTopic:
StoreKit