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

Commit 93d2aea

Browse files
committed
feat: add endpoint to return information for a specified cart
1 parent 7c54f3f commit 93d2aea

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/Api/GuestCarts.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,20 @@ public function create()
1414
return $this->post('/guest-carts');
1515
}
1616

17+
/**
18+
* Enable a guest user to return information for a specified cart.
19+
*
20+
* @return array
21+
*/
22+
public function cart($cartId)
23+
{
24+
return $this->get('/guest-carts/'.$cartId);
25+
}
26+
1727
/**
1828
* List items that are assigned to a specified cart.
1929
*
20-
* @return string
30+
* @return array
2131
*/
2232
public function items($cartId)
2333
{

tests/Api/GuestCartsTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ public function test_can_call_guest_carts_create()
2626
$this->assertTrue($api->ok());
2727
}
2828

29+
public function test_can_call_guest_carts_cart()
30+
{
31+
Http::fake();
32+
33+
$magento = new Magento();
34+
35+
$api = $magento->api('guestCarts')->cart('foo');
36+
37+
$this->assertTrue($api->ok());
38+
}
39+
2940
public function test_can_call_guest_carts_items()
3041
{
3142
Http::fake();

0 commit comments

Comments
 (0)