定制 alexander-emelyanov/opteck-api-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

alexander-emelyanov/opteck-api-client

Composer 安装命令:

composer require alexander-emelyanov/opteck-api-client

包简介

PHP Client for Opteck platform

README 文档

README

Build Status StyleCI Code Climate Code Climate

This repository contains PHP Client for Opteck platform.

Opteck is a trading platform for binary options.

Installation

Install using Composer, doubtless.

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

Usage

First, you need to create a client object to connect to the Opteck servers. You will need to acquire an Affiliate ID and Partner ID for your app first from broker website , then pass the credentials to the client object for logging in.

$client = new \Opteck\ApiClient(<Affiliate ID>, <Partner ID>);

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

Create lead

You can create lead on the Opteck platform using one request.

/** @var \Opteck\Requests\CreateLead $request */
$request = new \Opteck\Requests\CreateLead([
    'email'       => 'john.smith@gmail.com',
    'password'    => 'qwerty',
    'firstName'   => 'John',
    'lastName'    => 'Smith',
    'language'    => 'EN',
    'country'     => 'GB',
    'phone'       => '442088963321', // Pizza Hut Restaurant
    'campaign'    => 'test_campaign_1',
    'subCampaign' => 'test_sub_campaign_1',
]);

/** @var \Opteck\Responses\CreateLead $response */
$response = $apiClient->createLead($request);

echo "Lead created successfully with ID: " . $response->getLeadId() . PHP_EOL;

Get lead details

You should use Lead Details for auto-login as well and for retrieving more information about lead.

/** @var \Opteck\Responses\GetLeadDetails $leadDetails */
$leadDetails = $apiClient->getLeadDetails($email);

Auth

/** @var \Opteck\Responses\Auth $authResponse */
$authResponse = $apiClient->auth('john.smith@gmail.com', 'qwerty');

echo "Lead authorized with token [" . $authResponse->getToken() . "] valid up to " . $authResponse->getExpiryTimestamp() . PHP_EOL;

Get deposits

Code bellow retrieves all deposits for last 7 days.

/** @var \Opteck\Entities\Deposit[] $deposits */
$deposits = $apiClient->getDeposits(time() - 2600 * 24 * 7, time());

Trading

Get option types

/** @var \Opteck\Entities\OptionType[] $optionTypes */
$optionTypes = $apiClient->getOptionTypes();

Get markets

/** @var \Opteck\Entities\Market[] $markets */
$markets = $apiClient->getMarkets();

Get assets

/** @var \Opteck\Entities\Asset[] $assets */
$assets = $apiClient->getAssets();

Get asset rate

/** @var \Opteck\Responses\GetAssetRate $assetRate */
$assetRate = $apiClient->getAssetRate(<Asset ID>);

Trade

This package provide special wrapper for Opteck logic. You can use it for easy trading.

$apiClient->openPosition('<Email>', '<Password>', '<Symbol>', <Direction>, <Amount>);

Trade actions report

/** \Opteck\Entities\TradeAction[] $tradeActions */
$tradeActions = $apiClient->getTradeActions('<Email>');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-04-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固