resnext/techfinancials-api-client

TechFinancials Web API client

0.2.2 2016-10-24 10:13 UTC

This package is not auto-updated.

Last update: 2024-11-09 20:56:15 UTC


README

Software License Build Status Code Coverage Packagist

Using this API client for TechFinancials platform you can open account for your leads, redirect these leads to broker's website with auto-login and retrieve deposits made by these leads.

Installation

Install using Composer, doubtless.

$ composer require resnext/techfinancials-api-client

General API Client usage.

$apiClient = new TechFinancials\ApiClient(<URL>, <USERNAME>, <PASSWORD>);

Trader registration

$request = new \TechFinancials\Requests\RegisterTraderRequest([
    'username' => 'email@domain.com',
    'firstName' => 'John',
    'lastName' => 'Smith',
    'email' => 'email@domain.com',
    'phone' => '12345678909',
    'countryCode' => 'DE',
    'currencyCode' => 'EUR',
    'password' => 'password',
    'trackingCode' => 'Your tracking code'
]);
/** @var \TechFinancials\Responses\RegisterTraderResponse $response */    
$response = $apiClient->registerTrader($request);

Find registered traders

/** @var \TechFinancials\Responses\FindAccountsResponse $response */
$response = $apiClient->findAccounts();
/** @var \TechFinancials\Entities\Account[] $accounts */
$accounts = $response->getAccounts();