How to solve the Enqueued and Thread issues thought the In App Purchase?

I looked rest of the code to check to look it was perfect, no missed by the followed the StoreKit tutorials by Apple Inc, and YouTube channel, too. I believed I was very closer to completed IAP! somehow, I noticed I got three codes to show the gray error that shows up after the app has frozen while it appeared sandbox account UIAlertController to purchase the products.

One Code Results:

Error: Enqueued from com.apple.main-thread (Thread 1)

Code Block
func purchase(product: IAPProduct) {
guard let productToPurchase = products.filter({
$0.productIdentifier == product.rawValue
}).first else {
return
}
let payment = SKPayment(product: productToPurchase)
/* Code Crashed
paymentQueue.add(payment)
*/
}


I built UITableView to show an Episode with the Purchase version. The error was the same as the previous code.

Code Block
if indexPath.row == 3 {
/* code crashed
IAPService.shared.purchase(product: .epsiode4non_consumable)
*/
}



Now This is a final code that has shown one word by the error that says; "Thread" without mentioning any what is the issues.

Code Block
extension IAPService: SKPaymentTransactionObserver {
func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
for transaction in transactions {
print(transaction.transactionState.status(), transaction.payment.productIdentifier)
switch transaction.transactionState {
case .purchased:
SKPaymentQueue.default().finishTransaction(transaction)
SKPaymentQueue.default().remove(self)
print("Successful Purchased!")
queue.finishTransaction(transaction)
case .failed:
SKPaymentQueue.default().finishTransaction(transaction)
SKPaymentQueue.default().remove(self)
print("Purchase is Failed.")
queue.finishTransaction(transaction)
case .restored:
SKPaymentQueue.default().finishTransaction(transaction)
SKPaymentQueue.default().remove(self)
print("Purchase Restore is Successful.")
queue.finishTransaction(transaction)
case .deferred:
SKPaymentQueue.default().finishTransaction(transaction)
SKPaymentQueue.default().remove(self)
print("Purchase is Deferred.")
queue.finishTransaction(transaction)
/* code crashed
default: queue.finishTransaction(transaction)
*/
}
}
}
}



I have no idea what is thread stands for? Someone can give me some tips about Thread for IAP issues?

How to solve the Enqueued and Thread issues thought the In App Purchase?
 
 
Q