Skip to content

Commit

Permalink
Import existing WHMCS client codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Grendel7 committed Mar 5, 2017
1 parent 856d8fa commit d05a34d
Show file tree
Hide file tree
Showing 7 changed files with 457 additions and 2 deletions.
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
# whmcs-sdk
A simple PHP wrapper for WHMCS's API
# WHMCS SDK

A simple wrapper around the WHMCS SDK.

## Installation
This package is installed using Composer. You can use the following command to add it to a project.

```bash
composer require hansadema/whmcs-sdk
composer update
```

## Usage
Create an API client:
```php
$api = new \HansAdema\WhmcsSdk\Client('https://example.com/whmcs/installation/url/', 'myusername', 'mypassword');
```

Send an API request:
```php
try {
$result = $api->acceptOrder([
'orderid' => 123,
'serverid' => 456,
//...
]);
} catch (\HansAdema\WhmcsSdk\RequestException $e) {
echo "Error connecting to WHMCS: ".$e->getMessage();
} catch (\HansAdema\WhmcsSdk\ResponseException $e) {
echo "There was an issue with your API call: ".$e->getMessage();
}
```
20 changes: 20 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "HansAdema/whmcs-sdk",
"description": "Simple OOP wrapper for the WHMCS API",
"minimum-stability": "stable",
"license": "MIT",
"authors": [
{
"name": "Hans Adema",
"email": "hans@hansadema.nl"
}
],
"autoload": {
"psr-4": {
"HansAdema\\WhmcsSdk\\" : "src/"
}
},
"require": {
"guzzlehttp/guzzle": "~6.0"
}
}
247 changes: 247 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d05a34d

Please sign in to comment.