-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be55760
commit 70256ce
Showing
8 changed files
with
124 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace Zoop\Contracts; | ||
|
||
use Zoop\Lib\APIResource; | ||
|
||
interface ZoopWebhooks{ | ||
|
||
/** | ||
* API Resource. | ||
* | ||
* @param $APIResource $APIResource | ||
*/ | ||
public function __construct(APIResource $APIResource); | ||
|
||
/** | ||
* Create a new Webhook | ||
* | ||
* @param $post array | ||
*/ | ||
public function create($post); | ||
|
||
/** | ||
* Delete a Webhook by id | ||
* | ||
* @param $webhookID string | ||
*/ | ||
public function delete($webhookID); | ||
|
||
/** | ||
* Retrieve the details of a Webhook by id | ||
* | ||
* @param $webhookID string | ||
*/ | ||
public function get($webhookID); | ||
|
||
/** | ||
* Returns a JSON object with a list of plans. | ||
*/ | ||
public function getAll(); | ||
} |
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,5 +1,5 @@ | ||
<?php | ||
|
||
namespace Zoop\Exceptions; | ||
namespace Zoop\src\Exceptions; | ||
|
||
class ZoopAuthenticationException extends \Exception{} |
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,5 +1,5 @@ | ||
<?php | ||
|
||
namespace Zoop\Exceptions; | ||
namespace Zoop\src\Exceptions; | ||
|
||
class ZoopException extends \Exception {} |
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,5 +1,5 @@ | ||
<?php | ||
|
||
namespace Zoop\Exceptions; | ||
namespace Zoop\src\Exceptions; | ||
|
||
class ZoopObjectNotFound extends \Exception {} |
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,15 @@ | ||
<?php | ||
|
||
namespace Zoop\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
class ZoopWebhooks extends Facade{ | ||
|
||
/** | ||
* @return string | ||
*/ | ||
protected static function getFacadeAccessor(){ | ||
return 'ZoopWebhooks'; | ||
} | ||
} |
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,57 @@ | ||
<?php | ||
|
||
namespace Zoop\Lib; | ||
|
||
|
||
class ZoopWebhooks implements \Zoop\Contracts\ZoopPlans { | ||
|
||
/** | ||
* API Resource | ||
* | ||
* @var object | ||
*/ | ||
protected $APIResource; | ||
|
||
/** | ||
* ZoopPlans constructor. | ||
* @param APIResource $APIResource | ||
*/ | ||
public function __construct(APIResource $APIResource){ | ||
$this->APIResource = $APIResource; | ||
} | ||
|
||
/** | ||
* @param array $post | ||
* @return mixed | ||
*/ | ||
public function create($post = []){ | ||
$api = 'webhooks'; | ||
return $this->APIResource->createAPI($api, $post); | ||
} | ||
|
||
/** | ||
* @param string $webhookID | ||
* @return mixed | ||
*/ | ||
public function delete($webhookID){ | ||
$api = 'webhooks/' . $webhookID; | ||
return $this->APIResource->deleteAPI($api); | ||
} | ||
|
||
/** | ||
* @param string $webhookID | ||
* @return mixed | ||
*/ | ||
public function get($webhookID){ | ||
$api = 'webhooks/' . $webhookID; | ||
return $this->APIResource->searchAPI($api); | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getAll(){ | ||
$api = 'webhooks'; | ||
return $this->APIResource->searchAPI($api); | ||
} | ||
} |
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