Skip to content

Commit 4e4bc5a

Browse files
committed
- Fix DELETE method using GET
- Add support for delete customer
1 parent 7a16088 commit 4e4bc5a

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/AbstractHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(Client $client)
4545
*/
4646
public function delete(string $url): Response
4747
{
48-
return $this->generateHttpResponse('GET', $url);
48+
return $this->generateHttpResponse('DELETE', $url);
4949
}
5050

5151
/**

src/Customers/CustomersClient.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ class CustomersClient extends AbstractHttpClient
1313
{
1414
const URL = '/customers';
1515

16+
/**
17+
* @param string $id
18+
* @return Response
19+
*/
20+
public function deleteCustomer(string $id): Response
21+
{
22+
$url = self::URL . '/' . $id;
23+
return $this->delete($url);
24+
}
25+
1626
/**
1727
* @param string|null $id
1828
* @param array $filters

0 commit comments

Comments
 (0)