| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
An SDK that provides multiple ways to interact with the Tradebyte API. For more information, visit TB.IO.
$ composer require kinimodmeyer/tradebyte-sdk//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 ...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=123Execute the test with the following:
$ ./vendor/bin/phpunit testsExecute the analysis with the following:
$ ./vendor/bin/phpcs src
$ ./vendor/bin/phpcs testsFix (if possible) with the following:
$ ./vendor/bin/phpcbf src
$ ./vendor/bin/phpcbf tests| Back | FazBrowse Home | New Git URL |