I work on this app when app purchase is enabled. Happy path everything is covered, everything is in order, I'm trying to find a bad path.
Simply put, a purchase is tied to a server-side component. When buying, when the transaction is in the "Buy" state, I must go to the server, which will allow you to use the user account. When the request returns, I then clear some things and end up calling -finishTransaction: on the SKPaymentQueue.
An invalid path is pretty much the case when for some reason the server call fails. The network is unavailable, the network timed out, the user closed the application immediately after purchasing it, and only before I could call the server did you name it.
My tests in simulator 5.1 with an account from the sandbox show me that an incomplete transaction with a purchase will be returned to the queue at the next start, and my delegate will be correctly called with it. But after some time, say, 5 minutes, for example, a boom, a deal has gone. Given all the stability of accounts in the sandbox, I am ready to call it in the implementation of the simulator, but it's hard to say.
What is the appropriate way to solve this problem?
Bonus question: when does an apple actually charge someone? It looks like it should be AFTER the application called -finishTransaction: but I could not find any evidence of this.
Thanks, / KRA
UPDATE: testing on a physical device, almost an hour, and the transaction still exists. Transaction disappearance seems to be a simulator.