https://github.com/iamleehom/ios-iap-verification-php
This PHP Class is help you to verification your Apple IAP receipt-data if your server is developed by PHP.
https://github.com/iamleehom/ios-iap-verification-php
apple apple-iap iap iap-verification ios-iap ios-iap-verification ios-php php
Last synced: 4 months ago
JSON representation
This PHP Class is help you to verification your Apple IAP receipt-data if your server is developed by PHP.
- Host: GitHub
- URL: https://github.com/iamleehom/ios-iap-verification-php
- Owner: iamleehom
- License: mit
- Created: 2016-08-04T10:36:54.000Z (almost 10 years ago)
- Default Branch: 1.x
- Last Pushed: 2019-10-10T08:28:56.000Z (over 6 years ago)
- Last Synced: 2025-12-14T14:58:29.634Z (7 months ago)
- Topics: apple, apple-iap, iap, iap-verification, ios-iap, ios-iap-verification, ios-php, php
- Language: PHP
- Homepage:
- Size: 28.3 KB
- Stars: 24
- Watchers: 2
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Apple In App Purchase Verification With PHP
[](https://packagist.org/packages/leehom1988/ios-iap-verification-php)
[](https://packagist.org/packages/leehom1988/ios-iap-verification-php)
[](//packagist.org/packages/leehom1988/ios-iap-verification-php)
[](https://packagist.org/packages/leehom1988/ios-iap-verification-php) [](https://gitter.im/ios-iap-verification/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
This PHP Class is help you to verification your Apple IAP receipt-data if your server is developed by PHP.
## Installation
It's recommended that you use [Composer](https://getcomposer.org/) to install this library.
```bash
$ composer require leehom1988/ios-iap-verification-php
```
This will install this library and all required dependencies. This library requires PHP 5.6.0 or newer.
## Usage(English)
Create an Demo.php file with the following contents:
```php
validateReceipt();
echo $result;
```
## Usage(中文)
创建一个名为Demo.php的文件,将以下内容拷贝至Demo.php文件中:
```php
validateReceipt();
echo $result;
```
## View results:
- Use PHP CLI, in the terminal windows, type the following contents:
```bash
$ php Demo.php start
```
- Directly access to your Demo.php file in your browser.
## Status codes:
- 21000
The App Store could not read the JSON object you provided.
- 21002
The data in the receipt-data property was malformed or missing.
- 21003
The receipt could not be authenticated.
- 21004
The shared secret you provided does not match the shared secret on file for your account.
Only returned for iOS 6 style transaction receipts for auto-renewable subscriptions.
- 21005
The receipt server is not currently available.
- 21006
This receipt is valid but the subscription has expired. When this status code is returned to your server, the receipt data is also decoded and returned as part of the response.
Only returned for iOS 6 style transaction receipts for auto-renewable subscriptions.
- 21007
This receipt is from the test environment, but it was sent to the production environment for verification. Send it to the test environment instead.
- 21008
This receipt is from the production environment, but it was sent to the test environment for verification. Send it to the production environment instead.
For Status codes more information, see [Apple Receipt Validation Programming Guide](https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref/doc/uid/TP40010573-CH104-SW1).
## Author:
If you have any question,Please be easy to contact me:
- Name: [LeeHom](https://diandian.iamleehom.com/)
- Email: lh411937409@gmail.com
- [Website](https://diandian.iamleehom.com/)
Hope it can help You, Just Enjoy It! 😁😁😁😁
- (If you like it, Star it!️⭐⭐️)
- (喜欢就给个星星吧!⭐️⭐)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.