1. Go to this page and download the library: Download nikandlv/laravel-cafebazaar 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/ */
php
// add a redirect route for example routes/api.php
Route::get('/iap/redirect', function(Illuminate\Http\Request $request) {
Nikandlv\LaravelCafebazaar\LaravelCafebazaar::handleRedirect($request);
});
bash
php artisan Cafebazaar code
php
namespace App\Http\Controllers;
use Nikandlv\LaravelCafebazaar\LaravelCafebazaar;
...
class MyController extends Controller {
function check() {
$cafebazaar = new LaravelCafebazaar();
$purchase = $cafebazaar->verifyPurchase('ir.nikandlv.package_id', 'product_id', 'purchase_token');
if($purchase->isValid()) {
echo 'yay!';
}
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.