A PHP SDK for ResellerClub’s API.
- PHP >= 7.0
This package is available through Packagist. To install in your project via Composer:
$ composer require pitchero/reseller-club
try {
$api = new ResellerClub\Api(
new ResellerClub\Config(123, 'api_key', true),
new GuzzleHttp\Client()
)
$request = new ResellerClub\Orders\BusinessEmails\Requests\BusinessEmailOrderRequest(
$customerId = 123,
$domain = 'some-domain.co.uk',
$numberOfAccount = 5,
$forNumberOfMonths = 1,
ResellerClub\Orders\InvoiceOption::noInvoice()
);
$response = $api->businessEmailOrder()->create($request);
// @todo - Handle a successful response within your codebase.
} catch(ResellerClub\Exceptions\ApiException $e) {
// @todo - Handle the exception within your codebase.
}
try {
$api = new ResellerClub\Api(
new ResellerClub\Config(123, 'api_key', true),
new GuzzleHttp\Client()
);
$request = new ResellerClub\Orders\Order(
$orderId = 123
);
$response = $api->businessEmailOrder()->delete($request);
// @todo - Handle the successful response within your codebase.
} catch(ResellerClub\Exceptions\ApiException $e) {
// @todo - Handle the exception within your codebase.
}
try {
$api = new ResellerClub\Api(
new ResellerClub\Config(123, 'api_key', true),
new GuzzleHttp\Client()
);
$request = new ResellerClub\Orders\Order(
$orderId = 123
);
$response = $api->businessEmailOrder()->get($request);
// @todo - Handle the successful response within your codebase.
} catch(ResellerClub\Exceptions\ApiException $e) {
// @todo - Handle the exception within your codebase.
}
try {
$api = new ResellerClub\Api(
new ResellerClub\Config(123, 'api_key', true),
new GuzzleHttp\Client()
);
$request = new ResellerClub\Orders\BusinessEmails\Requests\RenewRequest(
new ResellerClub\Orders\Order(
$orderId = 123
),
$months = 1,
$numberOfAccounts = 1,
ResellerClub\Orders\InvoiceOption::noInvoice()
);
$response = $api->businessEmailOrder()->renew($request);
// @todo - Handle the successful response within your codebase.
} catch(ResellerClub\Exceptions\ApiException $e) {
// @todo - Handle the exception within your codebase.
}
try {
$api = new ResellerClub\Api(
new ResellerClub\Config(123, 'api_key', true),
new GuzzleHttp\Client()
);
$request = new ResellerClub\Orders\BusinessEmails\Requests\AddEmailAccountRequest(
new ResellerClub\Orders\Order(
$orderId = 123
),
$numberOfAccounts = 1,
ResellerClub\Orders\InvoiceOption::noInvoice()
);
$response = $api->businessEmailOrder()->addEmailAccounts($request);
// @todo - Handle the successful response within your codebase.
} catch(ResellerClub\Exceptions\ApiException $e) {
// @todo - Handle the exception within your codebase.
}
try {
$api = new ResellerClub\Api(
new ResellerClub\Config(123, 'api_key', true),
new GuzzleHttp\Client()
);
$request = new ResellerClub\Orders\BusinessEmails\Requests\DeleteEmailAccountRequest(
new ResellerClub\Orders\Order(
$orderId = 123
),
$numberOfAccounts = 1
);
$response = $api->businessEmailOrder()->deleteEmailAccounts($request);
// @todo - Handle the successful response within your codebase.
} catch(ResellerClub\Exceptions\ApiException $e) {
// @todo - Handle the exception within your codebase.
}
try {
$api = new ResellerClub\Api(
new ResellerClub\Config(123, 'api_key', true),
new GuzzleHttp\Client()
);
$request = ResellerClub\Orders\EmailAccounts\Requests\CreateRequest(
ResellerClub\Orders\Order(
$orderId = 123
),
ResellerClub\EmailAddress(
$email = '[email protected]'
),
string $password,
ResellerClub\EmailAddress(
$notificationsEmail = '[email protected]'
),
$firstName = 'John',
$lastName = 'Doe',
$countryCode = 'UK',
$languageCode = 'en'
);
$response = $api->emailAccount()->create($request);
// @todo - Handle the successful response within your codebase.
} catch(ResellerClub\Exceptions\ApiException $e) {
// @todo - Handle the exception within your codebase.
}
try {
$api = new ResellerClub\Api(
new ResellerClub\Config(123, 'api_key', true),
new GuzzleHttp\Client()
);
$request = ResellerClub\Orders\EmailAccounts\Requests\DeleteRequest(
ResellerClub\Orders\Order(
$orderId = 123
),
ResellerClub\EmailAddress(
$email = '[email protected]'
)
);
$response = $api->emailAccount()->delete($request);
// @todo - Handle the successful response within your codebase.
} catch(ResellerClub\Exceptions\ApiException $e) {
// @todo - Handle the exception within your codebase.
}
try {
$api = new ResellerClub\Api(
new ResellerClub\Config(123, 'api_key', true),
new GuzzleHttp\Client()
);
$request = ResellerClub\Orders\EmailForwarders\Requests\CreateRequest(
ResellerClub\Orders\Order(
$orderId = 123
),
ResellerClub\EmailAddress(
$email = '[email protected]'
)
);
$response = $api->emailForwarder()->create($request);
// @todo - Handle the successful response within your codebase.
} catch(ResellerClub\Exceptions\ApiException $e) {
// @todo - Handle the exception within your codebase.
}
try {
$api = new ResellerClub\Api(
new ResellerClub\Config(123, 'api_key', true),
new GuzzleHttp\Client()
);
$request = ResellerClub\Orders\EmailAccounts\Requests\DeleteRequest(
ResellerClub\Orders\Order(
$orderId = 123
),
ResellerClub\EmailAddress(
$email = '[email protected]'
)
);
$response = $api->emailForwarder()->delete($request);
// @todo - Handle the successful response within your codebase.
} catch(ResellerClub\Exceptions\ApiException $e) {
// @todo - Handle the exception within your codebase.
}
try {
$ttl = new ResellerClub\TimeToLive(86400);
$request = new ResellerClub\Dns\A\Requests\AddRequest(
$domain = 'another-testing-domain.com',
$record = 'test',
new ResellerClub\IPv4Address('127.0.0.1'),
$ttl
);
$response = $api->aRecord()->add($request);
// @todo - Handle the successful response within your codebase.
} catch(ResellerClub\Exceptions\ApiException $e) {
// @todo - Handle the exception within your codebase.
}
try {
$ttl = new ResellerClub\TimeToLive(86400);
$request = new ResellerClub\Dns\Cname\Requests\UpdateRequest(
$domain = 'your.com',
$record = 'www',
$currentValue = 'cname.oldservice.com',
$newValue = 'cname.newservice.com',
$ttl
);
$response = $api->cnameRecord()->update($request);
// @todo - Handle the successful response within your codebase.
} catch(ResellerClub\Exceptions\ApiException $e) {
// @todo - Handle the exception within your codebase.
}
Licensed under the MIT License.
If you find an issue with this package, please open a GitHub Issue.