generated from vormkracht10/php-package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CreditInvoice, Creditor and Subscription resources
- Loading branch information
Showing
5 changed files
with
281 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Vormkracht10\WeFact\Resources; | ||
|
||
use GuzzleHttp\Client; | ||
|
||
class CreditInvoice extends Resource | ||
{ | ||
final public const CONTROLLER_NAME = 'creditinvoice'; | ||
|
||
public function __construct( | ||
protected Client $http, | ||
protected string $apiKey, | ||
protected string $apiUrl | ||
) { | ||
$this->http = $http; | ||
} | ||
|
||
public function getResourceName(): string | ||
{ | ||
return self::CONTROLLER_NAME; | ||
} | ||
} |
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,23 @@ | ||
<?php | ||
|
||
namespace Vormkracht10\WeFact\Resources; | ||
|
||
use GuzzleHttp\Client; | ||
|
||
class Creditor extends Resource | ||
{ | ||
final public const CONTROLLER_NAME = 'creditor'; | ||
|
||
public function __construct( | ||
protected Client $http, | ||
protected string $apiKey, | ||
protected string $apiUrl | ||
) { | ||
$this->http = $http; | ||
} | ||
|
||
public function getResourceName(): string | ||
{ | ||
return self::CONTROLLER_NAME; | ||
} | ||
} |
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,28 @@ | ||
<?php | ||
|
||
namespace Vormkracht10\WeFact\Resources; | ||
|
||
use Vormkracht10\WeFact\Exceptions\MethodNotAvailableException; | ||
|
||
class Subscription extends Resource | ||
{ | ||
final public const CONTROLLER_NAME = 'debtor'; | ||
|
||
public function getResourceName(): string | ||
{ | ||
return self::CONTROLLER_NAME; | ||
} | ||
|
||
/** | ||
* @param array<string, mixed> $params | ||
* @return MethodNotAvailableException|array<string, mixed> | ||
* | ||
* @throws MethodNotAvailableException | ||
*/ | ||
public function delete(array $params = []): MethodNotAvailableException|array | ||
{ | ||
throw new MethodNotAvailableException( | ||
sprintf('%s is not available for this resource.', __METHOD__) | ||
); | ||
} | ||
} |
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