wpsinc/wps-php-sdk

This package is abandoned and no longer maintained. No replacement package was suggested.

The official PHP SDK for the WPS API

0.0.3 2015-08-31 17:38 UTC

This package is not auto-updated.

Last update: 2018-09-26 14:17:32 UTC


README

This is a simple PHP Client that can connect to the WPS API. This package was developed to be used with Laravel 5.1 but can also be used stand alone as well.

Installation

Just add this to your composer.json and then run composer update

"wpsinc/wps-php-sdk": "dev-master"

You can also simply add it like this

composer require "wpsinc/wps-php-sdk:dev-master"

Laravel Setup

This sdk comes with support for Laravel 5.1. This includes a service provider as well as a facade for easy access. Once this package is pulled into your project just add this to your config/app.php file.

'providers' => [
    ...
    \Wps\WpsServiceProvider::class,
],

and then add the facade to your aliases array

'aliases' => [
    ...
    'Wps' => \Wps\Facades\Wps::class,
],

Configuration

If you are using Laravel then add a teamwork array to your config/services.php file

...
'wps' => [
    'base_uri'=>env('WPS_BASE_URI'),
    'username'=>env('WPS_USER'),
    'password'=>env('WPS_PASS'),
],

Use

If you are using the Facade with Laravel you can easily access WPS like this

Wps::product()->all();

Configuration Without Laravel

If you are not using Laravel you can instantiate the class like this

require "vendor/autoload.php";

use Wps\Sdk;

$wps = new Sdk([
    'auth' => ['username', 'password']
]);

$wps->product()->all();

View the tests for other examples as the documentation continues to be developed.