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

Commit fe55322

Browse files
authored
Merge pull request #64 from grayloon/customer-show
Customer Show Endpoint
2 parents b2c63d5 + ce29cb2 commit fe55322

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/Api/Customers.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,15 @@ public function resetPassword($email, $resetToken, $newPassword)
6565
'newPassword' => $newPassword,
6666
]);
6767
}
68+
69+
/**
70+
* Get the customer by Customer ID.
71+
*
72+
* @param int $id
73+
* @return array
74+
*/
75+
public function show($id)
76+
{
77+
return $this->get('/customers/'.$id);
78+
}
6879
}

tests/Api/CustomersTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,15 @@ public function test_can_reset_password()
6666

6767
$this->assertTrue($api->ok());
6868
}
69+
70+
public function test_can_customer_show()
71+
{
72+
Http::fake([
73+
'*rest/all/V1/customers/1' => Http::response([], 200),
74+
]);
75+
76+
$api = MagentoFacade::api('customers')->show(1);
77+
78+
$this->assertTrue($api->ok());
79+
}
6980
}

0 commit comments

Comments
 (0)