diff --git a/src/Ugyfelkartya.php b/src/Ugyfelkartya.php index 5ea7705..8324757 100644 --- a/src/Ugyfelkartya.php +++ b/src/Ugyfelkartya.php @@ -15,7 +15,7 @@ class Ugyfelkartya use IsSuccessfulResponse, SetErrorData; private Client $client; - private string $baseUrl = 'https://www.ugyfelkartya.hu/api'; + private string $baseUrl = 'https://www.ugyfelkartya.hu/api/'; /** @var array */ private array $headers = [ @@ -60,7 +60,7 @@ public function register( $body['zip_code'] = $zipCode; } - $jsonResponse = (string)($this->client->post('/registration', [ + $jsonResponse = (string)($this->client->post('registration', [ 'json' => $body ])->getBody()); @@ -71,7 +71,7 @@ public function register( public function getClientInfo(string $email): ?ClientInfoDto { - $jsonResponse = (string)($this->client->get("/clientinfo?email={$email}")->getBody()); + $jsonResponse = (string)($this->client->get("clientinfo?email={$email}")->getBody()); $response = $this->parseResponse($jsonResponse); @@ -80,7 +80,7 @@ public function getClientInfo(string $email): ?ClientInfoDto public function getCard(string $cardNumber): ?CardDto { - $jsonResponse = (string)($this->client->get("/card/{$cardNumber}")->getBody()); + $jsonResponse = (string)($this->client->get("card/{$cardNumber}")->getBody()); $response = $this->parseResponse($jsonResponse); @@ -89,7 +89,7 @@ public function getCard(string $cardNumber): ?CardDto public function deleteClient(int $clientId, int $storeId): ?ClientDeleteDto { - $jsonResponse = (string)($this->client->post('/client/delete', [ + $jsonResponse = (string)($this->client->post('client/delete', [ 'json' => [ 'client_id' => $clientId, 'store_id' => $storeId,