srleach / inapp-verify
Library to verify Apple App Store receipt data with Apple.
Installs: 4 186
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
This package is not auto-updated.
Last update: 2025-03-11 06:30:43 UTC
README
Verifies iOS App store receipts with Apple for authenticity
Installation
Install, as with most dependencies with Composer.
composer require srleach/inapp-verify
Configuration
You'll need to set a couple of environment variables for this to work correctly.
Environment Variable | Description |
---|---|
APPLE_IAP_SHARED_SECRET | The shared secret used in the iOS App |
APPLE_IAP_VERIFY_URL | The URL used to poll the app store for results |
An example for an application using the popular Dotenv library:
APPLE_IAP_VERIFY_URL=https://sandbox.itunes.apple.com/verifyReceipt
APPLE_IAP_SHARED_SECRET=kmdfkmsKADMF999KM
Usage
You can poll the service by passing the receipt data as gleaned from the response from Apple by into getReceipt()
.
return IAP::getReceipt($receiptData);
Optionally, you may choose to override the environment set shared secret:
return IAP::getReceipt($receiptData, $sharedSecret);