Skip to content

Commit

Permalink
fix base uri for guzzle client
Browse files Browse the repository at this point in the history
  • Loading branch information
xHeaven committed Oct 11, 2023
1 parent fecd111 commit ce3e711
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Ugyfelkartya.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string> */
private array $headers = [
Expand Down Expand Up @@ -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());

Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -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,
Expand Down

0 comments on commit ce3e711

Please sign in to comment.