econtract/compare

E-Contract BVBA comparison API package
2,780
Install
composer require econtract/compare
Latest Version:3.1.0
PHP:^7.2|^8.0
Laravel:6 – 9
Older releases:5
License:proprietary
Last Updated:May 6, 2022
Links: GitHub  ·  Packagist
Maintainer: econtract

E-Contract BVBA - Compare package

This package offers the integration of the Aanbieders.be comparison collection API. This API can be used by partners and affiliates of Aanbieders to leverage information from the Aanbieders comparison calculation engine on their own websites.

Installation

Pull this package in through Composer:


    {
        "require": {
            "econtract/compare": "3.*"
        }
    }

Next, you will need to add several values to your .env file:


    API_staging=false                       // Is this a staging server?
    API_host=your_secret_api_key            // API host
    API_key=your_public_api_key             // Public API key
    API_secret=your_secret_api_key          // Private API key

In order to use the API (and thus this package), an API key is required. If you are in need of such a key, please get in touch with Aanbieders.be via their website.

Laravel installation

Add the service provider to your config/app.php file:


    'providers'             => array(

        //...
        \Econtract\Compare\CompareServiceProvider::class,

    )

Add the API as an alias to your config/app.php file


    'facades'               => array(

        //...
        'Api'                   => \Econtract\Compare\Facades\Compare::class,

    ),

Usage

Laravel usage

You can access the API using the alias you have selected in your config/app.php file:

    
    $products = Api::getProducts(
        array(
            'sg'        => 'consumer',
            'cat'       => 'internet',
            'lang'      => 'nl',
        )
    );

    $suppliers = Api::getSuppliers(
        array(
            'sg'        => 'consumer',
            'cat'       => 'internet',
            'lang'      => 'nl',
        )
    );

    $comparisons = Api::createComparison(
        array(
            'sg'        => 'consumer',
            'cat'       => 'gas',
            'lang'      => 'nl',
            'u'         => '4000',
            'ut'        => 'kwh',
            'zip'       => '3540',
            't'         => 'no',
            'd'         => '0',
        )
    );

For information regarding all possible parameters and their properties, we kindly refer you to the API documentation.

Non-laravel usage


    include('vendor/autoload.php');

    use Econtract/Compare/CompareService;


    $dotenv = new Dotenv\Dotenv(__DIR__);
    $dotenv->load();


    $compareService = new CompareService();
    $compareService->getProducts(
        array(
            'sg'        => 'consumer',
            'cat'       => 'internet',
            'lang'      => 'nl',
        )
    );

License

This package is proprietary software and may not be copied or redistributed without explicit permission.

Contact

Charles Dekkers (owner)

Jan Oris (developer)

Related Packages

econtract/crm

e-Contract BVBA CRM API package

2,848 0
aanbieders/laravel-api

Laravel package to recover information of the Aanbieders.be Comparison service p...

295 0
cyvelnet/laravel5-fractal

A simple fractal service provider and transformer generator with model attribute...

190,170 79
njasm/laravel5-soundcloud

Soundcloud API Service Provider For Laravel 5

43,778 15

Version History

Version Released PHP Laravel License
3.1.0 ^7.2|^8.0 >=6.0 proprietary
3.0.0 ^7.2|^8.0 >=6.0 proprietary
2.2.0 >=5.6.0 ~5.1 proprietary
2.1.2 >=5.6.0 ~5.1 proprietary
2.1.1 >=5.6.0 ~5.1 proprietary