2017 © Pedro Peláez
 

library dislo-backend-sdk

Client library for backend Dislo APIs

image

ixolit/dislo-backend-sdk

Client library for backend Dislo APIs

  • Monday, July 23, 2018
  • by marcod85
  • Repository
  • 9 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 50 % Grown

The README.md

ixoplan-backend-sdk

PHP SDK for the Ixoplan Backend API, (*1)

Installation

Simply add ixoplan/ixoplan-backend-sdk and a provider of ixoplan/ixoplan-sdk-http (e.g. ixoplan/ixoplan-sdk-http-guzzle) to your composer.json, e.g:, (*2)

{
    "name": "myvendor/myproject",
    "description": "Using ixoplan-backend-sdk",
    "require": {
        "ixoplan/ixoplan-backend-sdk": "*"
        "ixoplan/ixoplan-sdk-http-guzzle": "*"
    }
}

Usage

Instantiate the Client

The client is designed for different transport layers. It needs a RequestClient interface (e.g. HTTPRequestClient) to actually communicate with Ixoplan., (*3)

use Ixolit\Dislo\Backend\Client;
use Ixolit\Dislo\HTTP\Guzzle\GuzzleHTTPClientAdapter;
use Ixolit\Dislo\Request\HTTPRequestClient;

$httpAdapter = new GuzzleHTTPClientAdapter();

$httpClient = new HTTPRequestClient(
    $httpAdapter,
    $host,
    $apiKey,
    $apiSecret
);

$apiClient = new Client($httpClient);

Coupons

Retrieve a list of all coupons in multiple requests, each limited to ten items:, (*4)

$apiClient = new \Ixolit\Dislo\Backend\Client($httpClient);

$limit = 10;
$offset = 0;
do {
    $couponListResponse = $apiClient->couponList($limit, $offset);
    foreach ($couponListResponse->getCoupons() as $coupon) {
        echo $coupon->getCode();
        $offset++;
    }
} while ($offset < $couponListResponse->getTotalCount());

The Versions

23/07 2018

dev-master

9999999-dev

Client library for backend Dislo APIs

  Sources   Download

MIT

The Requires

 

The Development Requires

23/07 2018
01/03 2018
31/01 2018