Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 14c0dcf

Browse files
committed
feat: order show endpoint
1 parent 593b469 commit 14c0dcf

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/Api/Orders.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,16 @@ public function all($pageSize = 50, $currentPage = 1, $filters = [])
2020
'searchCriteria[currentPage]' => $currentPage,
2121
]));
2222
}
23+
24+
/**
25+
* Loads a specified order.
26+
*
27+
* @param int $orderId
28+
*
29+
* @return array
30+
*/
31+
public function show($orderId)
32+
{
33+
return $this->get('/orders/'.$orderId);
34+
}
2335
}

tests/Api/OrdersTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,16 @@ public function test_can_call_magento_api_orders_all_with_filter()
3737

3838
$this->assertTrue($api->ok());
3939
}
40+
41+
42+
public function test_can_call_magento_show()
43+
{
44+
Http::fake([
45+
'*rest/all/V1/orders/1' => Http::response([], 200),
46+
]);
47+
48+
$api = MagentoFacade::api('orders')->show(1);
49+
50+
$this->assertTrue($api->ok());
51+
}
4052
}

0 commit comments

Comments
 (0)