Verify the transactionReceipt of SKPaymentTransaction

The transactionReceipt property of the SKPaymentTransaction class in StoreKit framework in iOS SDK is of type NSData and Apple isn’t very eager to tell us what it contains and what format of data it is in. However, Apple provides a service through which you can verify if this data is valid or not.

The process is explained in In-App Purchase’s Verifying Store Receipts page. But to make things easy, I have created an iOS SDK 5.0 compatible class which will do this for you. All you have to do is to pass the NSData transactionReceipt of an instance of SKPaymentTransaction to this class and wait for the response to come back.

I’ve named this class “SKTransactionReceiptVerifier” and you are free to use it in your projects or modify it to suit your needs.

You can download “SKTransactionReceiptVerifier” by clicking on this link. I hope this will help save your time.