Simulate failed transaction using StoreKitTest

228 Views Asked by At

I am trying to use StoreKitTest to simulate .failed transaction in my unit tests. For the test session I set:

testSession.failTransactionsEnabled = true
testSession.failureError = SKError.Code.unknown

after that I call:

testSession.buyProduct(productIdentifier: productIdentifier)

I assumed that func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) delegate method should be called with transactionState failed.Unfortunately the delegate method is not called, any ideas why?

I was able to simulate purchased transaction using StoreKitTest. I am using Xcode 12.0 beta 6.

0

There are 0 best solutions below