Skip to content

Commit 78b0b8d

Browse files
authored
Merge pull request #8 from dant89/bugfixes/improvements
Bugfixes/improvements
2 parents 69100f2 + 4e4bc5a commit 78b0b8d

5 files changed

Lines changed: 15 additions & 9 deletions

File tree

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ To install, run `composer require dant89/ixapi-client` in the root of your proje
1919
Use your provided key / secret credentials for the given implementor URL to return and then set a bearer token:
2020

2121
```php
22-
<?php
23-
2422
use Dant89\IXAPIClient\Client;
2523

2624
// Create base client
@@ -39,8 +37,6 @@ if ($response->getStatus() === 200) {
3937

4038
With the bearer token set, you can return data from all endpoints that require authentication, such as the products endpoints:
4139
```php
42-
<?php
43-
4440
// Query for products
4541
$response = $client->getHttpClient('products')
4642
->getProducts();

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"require": {
2525
"php": "^7.1",
26-
"ext-json": "^1.5",
26+
"ext-json": "*",
2727
"symfony/http-client": "^4.3"
2828
},
2929
"require-dev": {

composer.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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)