Download the PHP package nikapps/bazaar-api-laravel without Composer

On this page you can find all versions of the php package nikapps/bazaar-api-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package bazaar-api-laravel

Bazaar-Api-Laravel (BazaarApi for Laravel)

An Easy-To-Use CafeBazaar API helper package for Laravel Framework (Laravel 4.2.x)

Version 2.x is based on Bazaar-Api-PHP.

Installation

Simply run command:

Or you can add this package dependency to your Laravel's composer.json :

{
    "require": {
        "nikapps/bazaar-api-laravel": "2.*"
    }

}

Then update composer:

-

Add this package provider in your providers array [app/config/app.php]:

'Nikapps\BazaarApiLaravel\BazaarApiLaravelServiceProvider',

Next you need to publish configuration file. Run this command:

Run :

If you see a bazaar:refresh-token command, you are all set to go !

Configuration

Create a client

First of all, you should go to your cafebazaar panel and get client id and client secret.

Get refresh token

- don't forget to change <REDIRECT_URI> and <CLIENT_ID>.

- copy <CODE>

- replace <CODE> with the copied data.

Done!

Usage

Purchase

$purchase = BazaarApi::purchase('com.package.name', 'product_id', 'purchase_token');

//or you can pass an array
$purchase = BazaarApi::purchase([
    'package' => 'com.package.name',
    'product_id' => 'product_id',
    'purchase_token' => 'purchase_token'
]);

echo "Developer Payload: " . $purchase->getDeveloperPayload();
echo "PurchaseTime: " . $purchase->getPurchaseTime(); //instance of Carbon
echo "Consumption State: " . $purchase->getConsumptionState();
echo "Purchase State: " . $purchase->getPurchaseState();
echo "Kind: " . $purchase->getKind();

Subscription

$subscription = BazaarApi::subscription('com.package.name', 'subscription_id', 'purchase_token');

//or you can pass an array
$subscription = BazaarApi::subscription([
    'package' => 'com.package.name',
    'subscription_id' => 'subscription_id',
    'purchase_token' => 'purchase_token'
]);

echo "Initiation Time: " . $subscription->getInitiationTime(); // instance of Carbon
echo "Expiration Time: " . $subscription->getExpirationTime(); // instance of Carbon
echo "Auto Renewing: " . $subscription->isAutoRenewing(); // boolean
echo "Kind: " . $subscription->getKind();

Cancel Subscription

$cancelSubscription = BazaarApi::cancelSubscription('com.package.name', 'subscription_id', 'purchase_token');

//or you can pass an array
$cancelSubscription = BazaarApi::cancelSubscription([
    'package' => 'com.package.name',
    'subscription_id' => 'subscription_id',
    'purchase_token' => 'purchase_token'
]);

echo "Cancel Subscription: " . $cancelSubscription->isCancelled(); // bool

Refresh Token (Manually)

This packages refreshes token when it's necessary, but if you want you can do it manually.

$token = BazaarApi::refreshToken();

echo 'Access Token: ' . $token->getAccessToken();
echo 'Scope: ' . $token->getScope();
echo 'Expire In: ' . $token->getExpireIn();
echo 'Token Type: ' . $token->getTokenType();

Clear Cache

Run this command to clean your cache, this command also invalidates your token.

Dependencies

Contribute

Wanna contribute? simply fork this project and make a pull request!

License

This project released under the MIT License.

Donation

Donate via Paypal


All versions of bazaar-api-laravel with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version 4.2.*
nikapps/bazaar-api-php Version 1.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nikapps/bazaar-api-laravel contains the following files

Loading the files please wait ....