aporat / store-receipt-validator

PHP receipt validator for Apple iTunes, Google Play and Amazon App Store
Apache License 2.0
633 stars 153 forks source link

iOS 7+ receipts validation #57

Closed Juanmaramon closed 6 years ago

Juanmaramon commented 7 years ago

Apple deprecated transaction receipt base64 data way back in iOS 7. That means iOS 11 will fully remove it so you need to switch your code over to use the "new" app receipt.

Is it possible to validate a receipt (iOS 7+) using the "new" base64 encoded receipt with this validator?

aporat commented 7 years ago

do you have more information about that change? as far as I know, JSON encoded base64 receipt is the only possibility.

https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref/doc/uid/TP40010573-CH104-SW1

renekliment commented 6 years ago

This library can do both transaction receipts and the new app receipts.

You have to be careful though. In ->getLatestReceiptInfo(), you get an array and if you want the latest transaction receipt, you have to select the latest (what I do is sort by expiration date in ms and get the last).