PHPackages                             letharion/validate-apple-receipt - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. letharion/validate-apple-receipt

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

letharion/validate-apple-receipt
================================

Helps managing run-time code updates.

v0.3(9y ago)353PHPPHP &gt;=5.3.0

Since Oct 22Pushed 9y ago1 watchersCompare

[ Source](https://github.com/letharion/validate-in-app-purchase-iphone-ios-receipts)[ Packagist](https://packagist.org/packages/letharion/validate-apple-receipt)[ RSS](/packages/letharion-validate-apple-receipt/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

In App Purchase Receipt Validator - PHP
=======================================

[](#in-app-purchase-receipt-validator---php)

This code allows for server-side validation of iTunes receipts.

For single use, such as debugging and testing, it can be called from CLI:

```
$ php ./bin/itunes.php validate @my_receipt.txt "production" @password.txt

```

Where "my\_receipt.txt" is a plain text file with a iTunes receipt as a single line, or multiple receipts delimited by "\\n". The `@`-sign used for both the receipt and password causes the validator to use the input as filenames to read the real data from, as opposed to using the input directly.

Production can be switched for Sandbox as necessary to send the receipt to the two environments.

Can be called as part of a service:

```
