Skip to content

Commit

Permalink
Merge branch 'release/v1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
pvankouteren committed Oct 9, 2024
2 parents d462a1d + ba8df7f commit 4553b30
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Client
/**
* @var string
*/
protected string $baseUrl = 'https://dropshiphub.nl/api/v1/';
protected string $baseUrl = 'https://app.dropshiphub.nl/api/v1/';

/**
* @var GuzzleClient
Expand All @@ -35,7 +35,9 @@ class Client
/**
* Client constructor.
*
* @param string $token
* @param string $token Your Dropshiphub API token
* @param string $companyId Your Dropshiphub Company ID
* @param LoggerInterface|null $logger Optional PSR-3 logger if you want to do some debugging
*/
public function __construct(string $token, string $companyId, ?LoggerInterface $logger = null)
{
Expand Down
29 changes: 28 additions & 1 deletion src/Dropshiphub.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Dropshiphub
private Client $client;

/**
* Sendy constructor.
* Dropshiphub client constructor.
*
* @param Client $client
*/
Expand All @@ -21,26 +21,53 @@ public function __construct(Client $client)
$this->client = $client;
}

/**
* Ping the Dropshiphub API to check the connection
*
* @return array|string
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function ping(): array|string
{
return $this->client->request('get', 'ping');
}

/**
* Ping the Dropshiphub API with your token to check the connection
*
* @return array|string
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function status(): array|string
{
return $this->client->request('get', 'status');
}

/**
* Base accessor for the Company endpoint
*
* @return Company
*/
public function company(): Company
{
return new Company($this->client);
}

/**
* Base accessor for the Catalog endpoint
*
* @return Catalog
*/
public function catalog(): Catalog
{
return new Catalog($this->client);
}

/**
* Base accessor for the Supplier endpoint
*
* @return Supplier
*/
public function supplier(): Supplier
{
return new Supplier($this->client);
Expand Down

0 comments on commit 4553b30

Please sign in to comment.