nikandlv/laravel-cafebazaar is a Laravel package for cafebazaar development api package.
It currently has 2 GitHub stars and 16 downloads on Packagist (latest version 1.0).
Install it with composer require nikandlv/laravel-cafebazaar.
Discover more Laravel packages by nikandlv
or browse all Laravel packages to compare alternatives.
Last updated
Cafebazaar uses a non standard implementation of OAuth2.0, with this package you can use cafebazaar api without all of the headache that it brings.
Also Official Documents are not clear and not complete at all.
You can install the package via composer:
composer require nikandlv/laravel-cafebazaar
You have to publish the configuration
php artisan vendor:publish
# select [10] Provider: Nikandlv\LaravelCafebazaar\LaravelCafebazaarServiceProvider
Add a redirect route
<?php
// add a redirect route for example routes/api.php
Route::get('/iap/redirect', function(Illuminate\Http\Request $request) {
Nikandlv\LaravelCafebazaar\LaravelCafebazaar::handleRedirect($request);
});
Open up Cafebazaar developer panel and create a new client with redirect url you specified
Configure config/laravel-cafebazaar.php
Then run
php artisan Cafebazaar code
Open up the link and authorize the application
<?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!';
}
}
}
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.