Reputation: 237
Apple suggest to use SKPaymentQueue.default().finishTransaction(transaction) only when App provided functionality. So, in case when transactionStatus == .purchased I’ sending request to my backend. But what if I receive some fail (or networking fails)? I want to reject current transaction. But if I make SKPaymentQueue.default().finishTransaction(transaction) I’ll complete transaction, which mean successful payment (but it’s not)
How I can reject transaction here?
Upvotes: 3
Views: 350
Reputation: 2124
Method SKPaymentQueue.default().finishTransaction(transaction) will just remove transaction from transaction queue, Not completing transaction. It is correct way to remove transaction from transaction queue as it is failed & no longer required to do transaction operation.
You can also find same implementation approach in Apple storeKit sample code. You can check at file path: iOSInAppPurchases/iOSInAppPurchases/StoreObserver.m
Upvotes: 0