-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import existing WHMCS client codebase
- Loading branch information
Showing
7 changed files
with
457 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.