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

Commit e583e5f

Browse files
committed
feat: add guest carts items endpoint
1 parent df20275 commit e583e5f

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/Api/GuestCarts.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,14 @@ public function create()
1313
{
1414
return $this->post('/guest-carts');
1515
}
16+
17+
/**
18+
* List items that are assigned to a specified cart.
19+
*
20+
* @return string
21+
*/
22+
public function items($cartId)
23+
{
24+
return $this->post('/guest-carts/'.$cartId.'/items');
25+
}
1626
}

tests/Api/GuestCartsTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,15 @@ public function test_can_call_guest_carts_create()
2525

2626
$this->assertTrue($api->ok());
2727
}
28+
29+
public function test_can_call_guest_carts_items()
30+
{
31+
Http::fake();
32+
33+
$magento = new Magento();
34+
35+
$api = $magento->api('guestCarts')->items('foo');
36+
37+
$this->assertTrue($api->ok());
38+
}
2839
}

0 commit comments

Comments
 (0)