I have added IAP to my Mac Appstore application. I am unable to properly validate the receipt server-side. I am reading the receipt using this code:
NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
NSData *receipt = [NSData dataWithContentsOfURL:receiptURL];
// This is my own method to convert to base64
NSString *receiptString = [NSData base64forData:receipt];
I am then sending the data to my server which in turn queries https://buy.itunes.apple.com/verifyReceipt to see if the receipt is valid. I always end up with an invalid receipt whatever I'm trying. I have also tried using the gem Venice which has the same issue when I provide it my receipt file as plain text or encoded with base64
command line tool. But at the same time it fails with whichever receipt file I try from all of my apps in /Applications
.
Has anyone successfully implemented receipt validation on the Mac Appstore?