承接 alexander-emelyanov/tradesmarter-api-client 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alexander-emelyanov/tradesmarter-api-client

Composer 安装命令:

composer require alexander-emelyanov/tradesmarter-api-client

包简介

PHP Client for TradeSmarter platform

README 文档

README

Build Status StyleCI Code Climate

This repository contains PHP Client for TradeSmarter platform.

TradeSmarter is a trading platform for binary options.

Installation

Install using Composer, doubtless.

$ composer require alexander-emelyanov/tradesmarter-api-client

Usage

First, you need to create a client object to connect to the TradeSmarter servers. You will need to acquire an API username and API password for your app first from broker, then pass the credentials to the client object for logging in.

$client = new \TradeSmarter\ApiClient("https://<username>:<password>@<hostname>");

Assuming your credentials is valid, you are good to go!

Get countries list

/** @var \TradeSmarter\Responses\Country[] $countries */
$countries = $client->countries();

Register new customer

$request = new TradeSmarter\Requests\Register([
    'firstName' => 'John',
    'lastName' => 'Smith',
    'email' => 'john.smith@gmail.com',
    'confirmed' => 1,
    'password' => 'qwerty',
    'phone' => '+123456789',
    'country' => 'gb',
    'locale' => 'en-GB',
    'params' => [],
    'lead' => 0,
]);

/** @var \TradeSmarter\Responses\Register $response */
$response = $client->register($request);

Login user

$request = new \TradeSmarter\Requests\Login([
    'email' => 'john.smith@gmail.com',
    'password' => 'qwerty',
]);

/** @var \TradeSmarter\Responses\Login $response */
$response = $client->login($request);

Get user info

$request = new \TradeSmarter\Requests\Login([
    'email' => 'john.smith@gmail.com',
    'password' => 'qwerty',
]);

/** @var \TradeSmarter\Responses\UserInfo $response */
$response = $client->getUserInfo($request);

Contribution

You are welcome!

Running tests

You can run unit tests via PHPUnit:

$ vendor/bin/phpunit tests

Note: you should install dev dependencies for this package using

$ composer update --dev

统计信息

  • 总下载量: 1.87k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-03-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固