PHPackages                             vulehd/store-receipt-validator - 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. vulehd/store-receipt-validator

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

vulehd/store-receipt-validator
==============================

PHP library that can be used to validate base64 encoded iTunes in app purchase receipts.

1.1.0(11y ago)018Apache-2.0PHPPHP &gt;=5.4

Since Aug 8Pushed 11y ago1 watchersCompare

[ Source](https://github.com/vulehd/store-receipt-validator)[ Packagist](https://packagist.org/packages/vulehd/store-receipt-validator)[ Docs](https://github.com/aporat/store-receipt-validator)[ RSS](/packages/vulehd-store-receipt-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (14)Used By (0)

store-receipt-validator
=======================

[](#store-receipt-validator)

[![Latest Stable Version](https://camo.githubusercontent.com/26b3a55ae1269bb8842d74e649fa78a84e2b2f4d58eff4568dd9053ee3f4a7ef/68747470733a2f2f706f7365722e707567782e6f72672f61706f7261742f73746f72652d726563656970742d76616c696461746f722f76657273696f6e2e706e67)](https://packagist.org/packages/aporat/store-receipt-validator) [![Composer Downloads](https://camo.githubusercontent.com/653797ad41f82a7e741f1bec0b24facd9d4c9e8d2be0e1a795b234905a6cc05f/68747470733a2f2f706f7365722e707567782e6f72672f61706f7261742f73746f72652d726563656970742d76616c696461746f722f642f746f74616c2e706e67)](https://packagist.org/packages/aporat/store-receipt-validator)

[![Build Status](https://camo.githubusercontent.com/de602f78a2b4cd6f4be4154f34b8eeee19c491829a3e922055a6d7cfca12d931/68747470733a2f2f7472617669732d63692e6f72672f61706f7261742f73746f72652d726563656970742d76616c696461746f722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/aporat/store-receipt-validator) [![Dependency Status](https://camo.githubusercontent.com/53f12d70343c4b112386180d6a8b9753f31823989895d9d60ac978b366b913d6/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3534366634643863383130313036633261663030303562302f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/546f4d8c810106c2af0005b0) [![Coverage Status](https://camo.githubusercontent.com/5e64f3970bca3e78bf8a43c9e029bad01e6b62910881efb0a197322d8ace53f6/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f61706f7261742f73746f72652d726563656970742d76616c696461746f722e737667)](https://coveralls.io/r/aporat/store-receipt-validator)

PHP library that can be used to validate base64 encoded iTunes in app purchase receipts.

Requirements
------------

[](#requirements)

- PHP &gt;= 5.4

Getting Started
---------------

[](#getting-started)

The easiest way to work with this package is when it's installed as a Composer package inside your project. Composer isn't strictly required, but makes life a lot easier.

If you're not familiar with Composer, please see .

1. Add iap-validator to your application's composer.json.

    ```
     {
         ...
         "require": {
             "aporat/store-receipt-validator": "dev-master"
         },
         ...
     }

    ```
2. Run `php composer install`.
3. If you haven't already, add the Composer autoload to your project's initialization file. (example)

    ```
     require 'vendor/autoload.php';

    ```

Quick Example
-------------

[](#quick-example)

### iTunes

[](#itunes)

```
use ReceiptValidator\iTunes\Validator as iTunesValidator;

$validator = new iTunesValidator(iTunesValidator::ENDPOINT_PRODUCTION);

$receiptBase64Data = 'AluGxOuMy+RT1gkyFCoD1i1KT3KUZl+F5FAAW0ELBlCUbC9dW14876aW0OXBlNJ6pXbBBFB8K0LDy6LuoAS8iBiq3529aRbVRUSKCPeCDZ7apC2zqFYZ4N7bSFDMeb92wzN0X/dELxlkRH4bWjO67X7gnHcN47qHoVckSlGo/mpbAAADVzCCA1MwggI7oAMCAQICCGUUkU3ZWAS1MA0GCSqGSIb3DQEBBQUAMH8xCzAJBgNVBAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSYwJAYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEzMDEGA1UEAwwqQXBwbGUgaVR1bmVzIFN0b3JlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA5MDYxNTIyMDU1NloXDTE0MDYxNDIyMDU1NlowZDEjMCEGA1UEAwwaUHVyY2hhc2VSZWNlaXB0Q2VydGlmaWNhdGUxGzAZBgNVBAsMEkFwcGxlIGlUdW5lcyBTdG9yZTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMrRjF2ct4IrSdiTChaI0g8pwv/cmHs8p/RwV/rt/91XKVhNl4XIBimKjQQNfgHsDs6yju++DrKJE7uKsphMddKYfFE5rGXsAdBEjBwRIxexTevx3HLEFGAt1moKx509dhxtiIdDgJv2YaVs49B0uJvNdy6SMqNNLHsDLzDS9oZHAgMBAAGjcjBwMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAUNh3o4p2C0gEYtTJrDtdDC5FYQzowDgYDVR0PAQH/BAQDAgeAMB0GA1UdDgQWBBSpg4PyGUjFPhJXCBTMzaN+mV8k9TAQBgoqhkiG92NkBgUBBAIFADANBgkqhkiG9w0BAQUFAAOCAQEAEaSbPjtmN4C/IB3QEpK32RxacCDXdVXAeVReS5FaZxc+t88pQP93BiAxvdW/3eTSMGY5FbeAYL3etqP5gm8wrFojX0ikyVRStQ+/AQ0KEjtqB07kLs9QUe8czR8UGfdM1EumV/UgvDd4NwNYxLQMg4WTQfgkQQVy8GXZwVHgbE/UC6Y7053pGXBk51NPM3woxhd3gSRLvXj+loHsStcTEqe9pBDpmG5+sk4tw+GK3GMeEN5/+e1QT9np/Kl1nj+aBw7C0xsy0bFnaAd1cSS6xdory/CUvM6gtKsmnOOdqTesbp0bs8sn6Wqs0C9dgcxRHuOMZ2tm8npLUm7argOSzQ==';

try {
    $response = $validator->setReceiptData($receiptBase64Data)->validate();
} catch (Exception $e) {
    echo 'got error = ' . $e->getMessage() . PHP_EOL;
}

if ($response->isValid()) {
    echo 'Receipt is valid.' . PHP_EOL;
    echo 'Receipt data = ' . print_r($response->getReceipt()) . PHP_EOL;
} else {
    echo 'Receipt is not valid.' . PHP_EOL;
    echo 'Receipt result code = ' . $response->getResultCode() . PHP_EOL;
}
```

### Play Store

[](#play-store)

Get the refresh token from [OAuth2 flow](https://developers.google.com/android-publisher/authorization).

```
use ReceiptValidator\GooglePlay\Validator as PlayValidator;
$validator = new PlayValidator([
    'client_id' => '...',
    'client_secret' => '...',
    'refresh_token' => '...'
]);

try{
    $response = $validator->setPackageName('com.example')
        ->setProductId('com.example.coins100')
        ->setPurchaseToken('....')
        ->validate();
}catch(Exception $e){
    var_dump($e->getMessage());
    // example message: Error calling GET ....: (404) Product not found for this application.
}
// success
```

Attributes contained in response are as [documented in Purchases.product](https://developers.google.com/android-publisher/api-ref/purchases/products#resource)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 59.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~21 days

Total

13

Last Release

4047d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fa3b0891f784bb401225d314088c1c49e760c9f29d7d43ba9d329bacb5683267?d=identicon)[vulehd](/maintainers/vulehd)

---

Top Contributors

[![aporat](https://avatars.githubusercontent.com/u/415576?v=4)](https://github.com/aporat "aporat (25 commits)")[![vulehd](https://avatars.githubusercontent.com/u/8856432?v=4)](https://github.com/vulehd "vulehd (11 commits)")[![grEvenX](https://avatars.githubusercontent.com/u/26375?v=4)](https://github.com/grEvenX "grEvenX (3 commits)")[![whs](https://avatars.githubusercontent.com/u/345483?v=4)](https://github.com/whs "whs (2 commits)")[![stokic](https://avatars.githubusercontent.com/u/2147162?v=4)](https://github.com/stokic "stokic (1 commits)")

---

Tags

itunespurchaseapplein appreceipt

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vulehd-store-receipt-validator/health.svg)

```
[![Health](https://phpackages.com/badges/vulehd-store-receipt-validator/health.svg)](https://phpackages.com/packages/vulehd-store-receipt-validator)
```

###  Alternatives

[readdle/app-store-receipt-verification

Pure PHP App Store receipt parsing/validation/verification without API calls to App Store API.

25201.4k](/packages/readdle-app-store-receipt-verification)[aporat/store-receipt-validator

PHP receipt validator for Apple App Store and Amazon Appstore

6503.9M9](/packages/aporat-store-receipt-validator)[readdle/app-store-server-api

Pure-PHP library that allows managing customer transactions using the App Store Server API and handling server-to-server notifications using the App Store Server Notifications V2

74373.5k1](/packages/readdle-app-store-server-api)[yanlongli/app-store-server-api

PHP client for App Store Server API. Manage your customers’ App Store transactions from your server.The App Store Server API is a REST API that you call from your server to request and provide information about your customers' in-app purchases. The App Store signs the transaction and subscription renewal information that this API returns using the JSON Web Signature (JWS) specification.App Store Server API is independent of the app’s installation status on the customer’s devices. The App Store server returns information based on the customer’s in-app purchase history regardless of whether the customer installed, removed, or reinstalled the app on their devices.To request transaction and subscription status information with this API, provide any original transaction identifier that belongs to the customer. The transaction history API responds with a complete list of transactions, 20 at a time, starting with the oldest first. The subscription status API returns the status for all of the customer’s subscriptions, organized by their subscription group identifier.Use the Send Consumption Information endpoint to send information to the App Store when customers request a refund for a consumable in-app purchase, after you receive the CONSUMPTION\_REQUEST App Store server notification. Your data helps inform refund decisions.

2532.0k](/packages/yanlongli-app-store-server-api)[alxmsl/appstoreclient

AppStore client for iTunes purchases receipts verification

2926.2k](/packages/alxmsl-appstoreclient)[dariusiii/php-itunes-api

Query iTunes API System

1116.9k](/packages/dariusiii-php-itunes-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
