PHP code example of asteriskpound / laravel-iap-verification
1. Go to this page and download the library: Download asteriskpound/laravel-iap-verification 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/ */
asteriskpound / laravel-iap-verification example snippets
use Asteriskpound\LaravelIapVerification\Facades\IapVerification;
$result = IapVerification::verify(platform: 'ios', transactionId: $transactionId);
// or: IapVerification::verify(platform: 'android', purchaseToken: $token, productId: $productId);
if ($result->isValid()) {
// grant entitlement in YOUR OWN subscription/user model, then tell the
// mobile app it's safe to call Payments::finish($transactionId)
}