LaravelPackages.net
Acme Inc.
Toggle sidebar
nikandlv/laravel-cafebazaar

Cafebazaar development api package

16
2
1.0
About nikandlv/laravel-cafebazaar

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

Laravel Cafebazaar API implementation

Latest Version on Packagist Build Status Quality Score Total Downloads

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.

Requirements

  • Laravel 5.5 ~ 6.+

Installation

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

Usage

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!';
        }
    }
}

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Star History Chart