Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/get orders #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/TIClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class TIClient
/**
*
* @param string $token token from tinkoff.ru for specific site
* @param TISiteEnum $site site name (sandbox or real exchange)
* @param string $site site name (sandbox or real exchange), @see TISiteEnum constants
* @param null $account
* @throws TIException
*/
Expand Down Expand Up @@ -546,7 +546,11 @@ public function cancelOrder($orderId)
public function getOrders($orderIds = null)
{
$orders = [];
$response = $this->sendRequest("/orders", "GET");
$response = $this->sendRequest(
"/orders",
"GET",
["brokerAccountId" => $this->brokerAccountId]
);
foreach ($response->getPayload() as $order) {
if ($orderIds === null || in_array($order->orderId, $orderIds)) {
$ord = new TIOrder(
Expand Down
2 changes: 1 addition & 1 deletion src/TIPortfolio.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function __construct($currencies, $instruments) {

/**
* Get balance of currency
* @param TICurrencyEnum $currency
* @param string $currency @see TICurrencyEnum constants
* @return double or false
*/
public function getCurrencyBalance($currency)
Expand Down