As I stated in my PR #33,
service points endpoints uses a different url : https://servicepoints.sendcloud.sc/api/v2/.
This can quite a bit confusing to use :
use JouwWeb\Sendcloud\Client;
$client = new Client('your_public_key', 'your_secret_key');
$client->getUser(); // HTTP 200 OK
$client->searchServicePoints('NL'); // HTTP 404 NOT FOUND
$client_2 = new Client('your_public_key', 'your_secret_key', null, 'https://servicepoints.sendcloud.sc/api/v2/');
$client_2->getUser(); // HTTP 404 NOT FOUND
$client_2->searchServicePoints('NL'); // HTTP 200
So I suggest something like this :
Client.php : Everything related to https://panel.sendcloud.sc/api/v2/
ServicePointsClient.php : Everything related to https://servicepoints.sendcloud.sc/api/v2/
Move parseGuzzleException() to Utility.php
So now :
use JouwWeb\Sendcloud\Client;
use JouwWeb\Sendcloud\ServicePointsClient;
$client = new Client('your_public_key', 'your_secret_key');
$client->getUser(); // HTTP 200 OK
$client->searchServicePoints('NL'); // Method does not exist
$client_2 = new ServicePointsClient('your_public_key', 'your_secret_key');
$client_2->getUser(); // Method does not exist
$client_2->searchServicePoints('NL'); // HTTP 200 OK
As I stated in my PR #33, service points endpoints uses a different url :
https://servicepoints.sendcloud.sc/api/v2/
.This can quite a bit confusing to use :
So I suggest something like this :
Client.php
: Everything related tohttps://panel.sendcloud.sc/api/v2/
ServicePointsClient.php
: Everything related tohttps://servicepoints.sendcloud.sc/api/v2/
parseGuzzleException()
toUtility.php
So now :
Is this a good idea ?