2017 © Pedro Peláez
 

library solaris-api-client

PHP Client for Solaris platform

image

resnext/solaris-api-client

PHP Client for Solaris platform

  • Tuesday, October 4, 2016
  • by AlexanderEmelyanov
  • Repository
  • 1 Watchers
  • 1 Stars
  • 578 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Solaris API Client.

API Client for binary options platform Solaris., (*1)

Installation

Install using Composer, doubtless., (*2)

$ composer require resnext/solaris-api-client

General API Client usage.

Your can configure used HTTP client using $options param of ApiClient constructor., (*3)

Error handling

Each method of \Solaris\ApiClient can return response object (instance of \Solaris\Response) or throws two kind of exceptions., (*4)

  1. \Solaris\ServerException Server-side exception assigned with invalid data received of impossible operation is requested.
  2. \Solaris\ClientException Client-side exception means API Client cannot connect to Solaris servers or receive valid response with any reasons.

Configuration and customization

Example:, (*5)

$httpClient = new GuzzleHttp\Client([
   GuzzleHttp\RequestOptions::CONNECT_TIMEOUT => 2,
]);

$apiClient = new \Solaris\ApiClient(<API_URL>, <API_USERNAME>, <API_PASSWORD>, [
    'httpClient' => $httpClient,
]);

Get available countries list

For customer adding you need specify countryISO 3166-1 code (ex.: en, us, gb). You can get available for registration countries list as bellow:, (*6)

/** @var \Solaris\Responses\GetCountriesResponse $response */
$response = $apiClient->getCountries();
/** @var \Solaris\Entities\Country[] $countries */
$countries = $response->getCountries();

Add customer

Customer's adding is main method of any trade platform..., (*7)

$request = new \Solaris\Requests\AddCustomerRequest([
    'firstName' => 'John',
    'lastName' => 'Smith',
    'email' => 'john.smith@domain.com',
    'phone' => '123456789',
    'country' => 'cz',
    'currency' => 'USD',
    'password' => 'qwerty',
]);

/** @var \Solaris\Responses\AddCustomerResponse $response */
$response = $apiClient->addCustomer($request);

Get customer auto-login URL and auth key.

It is really easy:, (*8)

$request = new \Solaris\Requests\GetCustomerAuthKeyRequest(['email' => 'john.smith@domain.com']);

/**
 * @var \Solaris\Responses\GetCustomerAuthKeyResponse $response
 */
$response = $apiClient->getCustomerAuthKey($request);

echo $response->getAuthUrl();

Deposits retrieving

/** @var \Solaris\Responses\GetDepositsResponse $response */
$response = $apiClient->getDeposits();
/** @var \Solaris\Entities\Deposit[] $deposits */
$deposits = $response->getDeposits();

The Versions

04/10 2016

dev-master

9999999-dev

PHP Client for Solaris platform

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Emelyanov

api binary options solaris

04/10 2016

v0.1.2

0.1.2.0

PHP Client for Solaris platform

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Emelyanov

api binary options solaris

04/10 2016

v0.1.3

0.1.3.0

PHP Client for Solaris platform

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Emelyanov

api binary options solaris

04/10 2016

v0.1.5

0.1.5.0

PHP Client for Solaris platform

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Emelyanov

api binary options solaris

04/10 2016

v0.1.6

0.1.6.0

PHP Client for Solaris platform

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Emelyanov

api binary options solaris

12/07 2016

v0.1.1

0.1.1.0

PHP Client for Solaris platform

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Emelyanov

api binary options solaris

12/07 2016

v0.1.0

0.1.0.0

PHP Client for Solaris platform

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Emelyanov

api binary options solaris