Skip to content

Commit 8570bf2

Browse files
authored
Merge pull request #21 from Kucoin/dev
Fixed getDetailByClientOid
2 parents bbff8e9 + 61757a4 commit 8570bf2

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/PrivateApi/Order.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function getOpenOrderStatistics($symbol = null)
164164
*/
165165
public function getDetailByClientOid($clientOid)
166166
{
167-
$response = $this->call(Request::METHOD_GET, '/api/v1/orders/' . $clientOid, ['clientOid' => $clientOid]);
167+
$response = $this->call(Request::METHOD_GET, '/api/v1/orders/byClientOid', ['clientOid' => $clientOid]);
168168
return $response->getApiData();
169169
}
170170

tests/OrderTest.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,19 @@ private function getOrderId($api)
237237
*/
238238
public function testGetDetailByClientOid(Order $api)
239239
{
240-
$clientOid = 'eresc138b21023a909e5ad59';
240+
$clientOid = uniqid();
241+
$order = [
242+
'clientOid' => $clientOid,
243+
'type' => 'limit',
244+
'side' => 'buy',
245+
'symbol' => 'XBTUSDTM',
246+
'leverage' => 1,
247+
'remark' => 'create test order',
248+
'price' => '1',
249+
'size' => '1',
250+
];
251+
252+
$api->create($order);
241253
$order = $api->getDetailByClientOid($clientOid);
242254
$this->assertArrayHasKey('symbol', $order);
243255
$this->assertArrayHasKey('hidden', $order);
@@ -257,6 +269,7 @@ public function testGetDetailByClientOid(Order $api)
257269
$this->assertArrayHasKey('status', $order);
258270
$this->assertArrayHasKey('updatedAt', $order);
259271
$this->assertArrayHasKey('orderTime', $order);
272+
$api->cancel($order['id']);
260273
}
261274

262275
/**

0 commit comments

Comments
 (0)