2017 © Pedro Peláez
 

library ls-ecom-guzzle

A Guzzle HTTP Client extension for Lightspeed eCommerce

image

lightspeedhq/ls-ecom-guzzle

A Guzzle HTTP Client extension for Lightspeed eCommerce

  • Monday, October 2, 2017
  • by jamesratcliffe
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Guzzle Client for Lightspeed eCommerce

The class is an extension of the Guzzle 6 PHP HTTP Client for use with the Lightspeed eCommerce API., (*1)

It works the same way as the standard Guzzle Client, but takes care of rate limiting., (*2)

This package was created for demonstration purposes and comes with no waranty., (*3)

Installation

Use this commmand to install with Composer:, (*4)

$ composer require lightspeedhq/ls-ecom-guzzle:~1.0

Alternatively, you can add these lines to your composer.json file:, (*5)

    "require": {
        "lightspeedhq/ls-ecom-guzzle": "~1.0"
    }

Usage Example

<?php

require 'vendor/autoload.php';
use LightspeedHQ\Ecom\EcomClient;

$cluster = 'us1';     // eu1 or us1
$language = 'us';     // Shop language
$key = 'xxxx';        // API key
$secret = 'xxxx';     // API secret

$client = new EcomClient($cluster, $language, $key, $secret);

// GET request with some URL paramters.
$query = ['since_id', 1];
$response = $client->get('customers', ['query' => $query]);
$customers = json_decode($response->getBody(), true)['customers'];
echo '

';
echo '

GET Test

'; var_dump($customers[0]); echo '
'; // POST request to create a discount code $payload = [ 'discount' => [ 'discount' => 5, 'isActive' => true, 'minumumAmount' => 50, 'applyTo' => 'productscategories', 'endDate' => '2018-01-01', 'type' => 'percentage', 'code' => '5PERCENT', 'startDate' => '2017-01-01', 'usageLimit' => 9999, ] ]; $response = $client->post('discounts', ['json' => $payload]); echo '

POST Test

'; echo '
';
var_dump(json_decode($response->getBody(), true));
echo '
';

The Versions

02/10 2017

dev-master

9999999-dev https://github.com/jamesratcliffe/ls-ecom-guzzle

A Guzzle HTTP Client extension for Lightspeed eCommerce

  Sources   Download

MIT

The Requires

 

by Michael Carey
by James Ratcliffe

api rest guzzle ecommerce pos lightspeed

02/10 2017

v1.0.1

1.0.1.0 https://github.com/jamesratcliffe/ls-ecom-guzzle

A Guzzle HTTP Client extension for Lightspeed eCommerce

  Sources   Download

MIT

The Requires

 

by Michael Carey
by James Ratcliffe

api rest guzzle ecommerce pos lightspeed

29/09 2017

v1.0

1.0.0.0 https://github.com/jamesratcliffe/ls-ecom-guzzle

A Guzzle HTTP Client extension for Lightspeed eCommerce

  Sources   Download

MIT

The Requires

 

by Michael Carey
by James Ratcliffe

api rest guzzle ecommerce pos lightspeed