-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from darthsoup/next
feat: new structure with laravel-manager for multiple connections
- Loading branch information
Showing
15 changed files
with
307 additions
and
256 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
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
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
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,50 +1,46 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| HTTP Driver | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Supported: "guzzlehttp" | ||
*/ | ||
declare(strict_types=1); | ||
|
||
'driver' => 'guzzlehttp', | ||
return [ | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| API Credentials | ||
| Default Connection | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Enter the unhashed variant of your password if you use 'password' as 'auth_type' | ||
| | ||
| Supported auth types': "api", "password" | ||
| Define your default whmcs connection | ||
| | ||
*/ | ||
|
||
'auth_type' => env('WHMCS_AUTH_TYPE', 'password'), | ||
|
||
'apiurl' => env('WHMCS_API_URL', 'https://url.to.whmcs.tld/whmcs/includes/api.php'), | ||
|
||
'api' => [ | ||
'identifier' => env('WHMCS_API_IDENTIFIER', 'YOUR_API_IDENTIFIER'), | ||
'secret' => env('WHMCS_API_SECRET', 'YOUR_API_SECRET'), | ||
], | ||
|
||
'password' => [ | ||
'username' => env('WHMCS_USERNAME', 'YOUR_USERNAME'), | ||
'password' => env('WHMCS_PASSWORD', 'YOUR_PASSWORD'), | ||
], | ||
'default' => 'primary', | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| ResponseType | ||
| WHMCS Connections | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Supported auth types': "json", "xml" | ||
| Define your whmcs connections here. | ||
| Do not add the path `/includes/api.php` to the URL, it will be added automatically. | ||
| | ||
| Methods: "password", "token" | ||
| | ||
*/ | ||
|
||
'responsetype' => env('WHMCS_RESPONSE_TYPE', 'json'), | ||
'connections' => [ | ||
|
||
'primary' => [ | ||
'method' => env('WHMCS_AUTH_TYPE', 'password'), | ||
'url' => env('WHMCS_API_URL', 'https://url.to.whmcs.tld/whmcs'), | ||
'username' => env('WHMCS_USERNAME', 'YOUR_USERNAME'), | ||
'password' => env('WHMCS_PASSWORD', 'YOUR_PASSWORD'), | ||
], | ||
|
||
'secondary' => [ | ||
'method' => env('WHMCS_AUTH_TYPE', 'token'), | ||
'url' => env('WHMCS_API_URL', 'https://url.to.whmcs.tld/whmcs'), | ||
'identifier' => env('WHMCS_API_IDENTIFIER', 'YOUR_API_IDENTIFIER'), | ||
'secret' => env('WHMCS_API_SECRET', 'YOUR_API_SECRET'), | ||
] | ||
] | ||
]; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DarthSoup\Whmcs\Auth; | ||
|
||
use DarthSoup\WhmcsApi\Client; | ||
|
||
abstract class AbstractAuth implements AuthInterface | ||
{ | ||
protected ?Client $client; | ||
|
||
public function with(Client $client): AuthInterface | ||
{ | ||
$this->client = $client; | ||
|
||
return $this; | ||
} | ||
} |
Oops, something went wrong.