letharion/validate-apple-receipt

There is no license information available for the latest version (v0.3) of this package.

Helps managing run-time code updates.

v0.3 2016-11-04 10:14 UTC

This package is not auto-updated.

Last update: 2024-12-27 22:56:32 UTC


README

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:

<?php
$endpoint = itunesReceiptValidator::PRODUCTION_URL;
(new itunesReceiptValidator($endpoint, $password))->validateReceipt($receipt)