PHP code example of leehom1988 / ios-iap-verification-php
1. Go to this page and download the library: Download leehom1988/ios-iap-verification-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
leehom1988 / ios-iap-verification-php example snippets
LeeHom\AppleInAppPurchaseVerification;
// The receipt-data from apple
$receiptData = 'MIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
// The password your own, if your IAP is not a subscription, let it empty string(like this:''), else use your own password
$password = 'baXXXXXXXXXXXXXXXXXXXXXXXXX';
$appleIAP = new AppleInAppPurchaseVerification($receiptData, $password, true);
$result = $appleIAP->validateReceipt();
echo $result;