The SKPaymentTransactionObserver protocol declares methods that are implemented by observers of an SKPaymentQueue object. In a nutshell, what the SKPaymentTransactionObserver class does is observe and catch the callbacks from the payment queue when the iTunes store processes the payment. i.e. it let’s you catch the success and failure events.
The SKPaymentQueue class provides a queue of payment transactions to be processed by the App Store. The payment queue communicates with the App Store and presents a user interface so that the user can authorize payment. The contents of the queue are persistent between launches of your app.
An observer is called when transactions are updated by the queue or removed from the queue. An observer should process all successful transactions, unlock the functionality purchased by the user, and then finish the transaction by calling the payment queue’s finishTransaction: method.
– paymentQueue:updatedTransactions: // Required method – paymentQueue:removedTransactions:
Handling Restored Transactions
– paymentQueue:restoreCompletedTransactionsFailedWithError: – paymentQueueRestoreCompletedTransactionsFinished:
Handling Download Actions
– paymentQueue:updatedDownloads: // required method
1. you implement the required methods, e.g.
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
which lets you run through all the updated transactions.
2. Then you check the transaction state and, for each state, do the required action. E.g.
If it’s SKPaymentTransactionStatePurchased then you need to complete the transaction.
Remember to call:
[[SKPaymentQueue defaultQueue] finishTransaction: transaction];
after processing each transaction.
and a good SO post here: