2017 © Pedro Peláez
 

library store-receipt-validator

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

image

vulehd/store-receipt-validator

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

  • Thursday, April 23, 2015
  • by vulehd
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 94 Forks
  • 0 Open issues
  • 14 Versions
  • 0 % Grown

The README.md

store-receipt-validator

Latest Stable Version Composer Downloads, (*1)

Build Status Dependency Status Coverage Status, (*2)

PHP library that can be used to validate base64 encoded iTunes in app purchase receipts., (*3)

Requirements

  • PHP >= 5.4

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., (*4)

If you're not familiar with Composer, please see http://getcomposer.org/., (*5)

  1. Add iap-validator to your application's composer.json., (*6)

    {
        ...
        "require": {
            "aporat/store-receipt-validator": "dev-master"
        },
        ...
    }
  2. Run php composer install., (*7)

  3. If you haven't already, add the Composer autoload to your project's initialization file. (example), (*8)

    require 'vendor/autoload.php';

Quick Example

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

Get the refresh token from OAuth2 flow., (*9)

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, (*10)

The Versions

23/04 2015

dev-master

9999999-dev https://github.com/vulehd/store-receipt-validator

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

purchase apple receipt itunes in app

19/04 2015

1.1.0

1.1.0.0 https://github.com/aporat/store-receipt-validator

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

purchase apple receipt itunes in app

03/03 2015

1.0.13

1.0.13.0 https://github.com/aporat/store-receipt-validator

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

purchase apple receipt itunes in app

26/02 2015

1.0.12

1.0.12.0 https://github.com/aporat/store-receipt-validator

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

purchase apple receipt itunes in app

25/02 2015

1.0.11

1.0.11.0 https://github.com/aporat/store-receipt-validator

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

purchase apple receipt itunes in app

04/02 2015

1.0.10

1.0.10.0 https://github.com/aporat/store-receipt-validator

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

purchase apple receipt itunes in app

30/01 2015

1.0.9

1.0.9.0 https://github.com/aporat/store-receipt-validator

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

purchase apple receipt itunes in app

09/12 2014

1.0.8

1.0.8.0 https://github.com/aporat/store-receipt-validator

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

purchase apple receipt itunes in app

21/11 2014

1.0.7

1.0.7.0 https://github.com/aporat/store-receipt-validator

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

purchase apple receipt itunes in app

31/10 2014

1.0.6

1.0.6.0 https://github.com/aporat/store-receipt-validator

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

purchase apple receipt itunes in app

13/08 2014

1.0.5

1.0.5.0 https://github.com/aporat/store-receipt-validator

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

purchase apple receipt itunes in app

13/08 2014

1.0.4

1.0.4.0 https://github.com/aporat/store-receipt-validator

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

purchase apple receipt itunes in app

08/08 2014

1.0.2

1.0.2.0 https://github.com/aporat/store-receipt-validator

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

purchase apple receipt itunes in app

08/08 2014

1.0.0

1.0.0.0 https://github.com/aporat/store-receipt-validator

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

purchase apple receipt itunes in app