Download src/Billing/Domain/Exceptions/SubscriptionNotFoundException.php from pnacorp/AIKEEDO: direct link, hf CLI and curl.
- Browser
- Download file 1.19 kB
-
https://huggingface.co/pnacorp/AIKEEDO/resolve/main/src/Billing/Domain/Exceptions/SubscriptionNotFoundException.php
- Command line
-
hf download hf://pnacorp/AIKEEDO/src/Billing/Domain/Exceptions/SubscriptionNotFoundException.php
-
curl -L -o SubscriptionNotFoundException.php https://huggingface.co/pnacorp/AIKEEDO/resolve/main/src/Billing/Domain/Exceptions/SubscriptionNotFoundException.php
1.19 kB
| declare(strict_types=1); | |
| namespace Billing\Domain\Exceptions; | |
| use Billing\Domain\ValueObjects\ExternalId; | |
| use Billing\Domain\ValueObjects\PaymentGateway; | |
| use Exception; | |
| use Shared\Domain\ValueObjects\Id; | |
| use Throwable; | |
| class SubscriptionNotFoundException extends Exception | |
| { | |
| public readonly ?Id $id; | |
| public readonly ?PaymentGateway $gateway; | |
| public readonly ?ExternalId $externalId; | |
| public function __construct( | |
| Id|ExternalId $id, | |
| ?PaymentGateway $gateway = null, | |
| int $code = 0, | |
| ?Throwable $previous = null, | |
| ) { | |
| if ($id instanceof Id) { | |
| $message = sprintf( | |
| "Subscription with <%s> doesn't exists!", | |
| $id->getValue() | |
| ); | |
| $this->id = $id; | |
| $this->externalId = null; | |
| } else { | |
| $message = sprintf( | |
| "Subscription with <%s:%s> doesn't exists!", | |
| $id->value ?: '', | |
| $gateway->value ?: '' | |
| ); | |
| $this->id = null; | |
| $this->externalId = $id; | |
| } | |
| $this->gateway = $gateway; | |
| parent::__construct($message, $code, $previous); | |
| } | |
| } | |