kinimodmeyer/tradebyte-sdk
最新稳定版本:v0.4.0
Composer 安装命令:
composer require kinimodmeyer/tradebyte-sdk
包简介
Tradebyte SDK
README 文档
README
An SDK that provides multiple ways to interact with the Tradebyte API. For more information, visit TB.IO.
Features
- Memory Efficiency: The SDK is designed to consume minimal memory and can efficiently process large XML files - potentially gigabytes in size - through extensive use of iterators and XML readers.
- Flexible Processing: Depending on your needs, you can process data "on the fly" or opt for a "download and re-open" approach.
- Supported Entities: The SDK supports several entities with multiple endpoints, including: product, order, message, stock, upload
Requirements
- Credentials (username, password, account-number)
- PHP >= 7.4
- Composer
- cURL
Installation
- download composer (https://getcomposer.org/download)
- execute the following:
$ composer require kinimodmeyer/tradebyte-sdk
Quick Example (message)
//only needed if not already included require './vendor/autoload.php'; $client = new Tradebyte\Client([ 'credentials' => [ 'account_number' => '', 'account_user' => '', 'account_password' => '' ] ]); //different handler can be used here $messageHandler = $client->getMessageHandler(); //fetch message with message-identifier 5 var_dump($messageHandler->getMessage(5)->getId()); //or download/reopen message $messageHandler->downloadMessage(__DIR__.'/message_5.xml', 5); var_dump($messageHandler->getMessageFromFile(__DIR__.'/message_5.xml')); //see also the other possible methods on the handler for list-handling, acknowledge an many more ...
Example Files
Copy the vendor/kinimodmeyer/tradebyte-sdk/examples/ folder to your project-root.
Rename examples/example_credentials.php to examples/credentials.php and replace the credentials.
Execute the examples from the cli:
$ php examples/products.php channel=1370 id=123 $ php examples/orders.php $ php examples/messages.php $ php examples/stock.php channel=1370 delta=123
Tests
Execute the test with the following:
$ ./vendor/bin/phpunit tests
Code Analysis
Execute the analysis with the following:
$ ./vendor/bin/phpcs src $ ./vendor/bin/phpcs tests
Fix (if possible) with the following:
$ ./vendor/bin/phpcbf src $ ./vendor/bin/phpcbf tests
统计信息
- 总下载量: 7.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-10-14