|null $response */ public function __construct( public readonly bool $success, public readonly string $provider, public readonly ?string $requestId = null, public readonly ?string $providerCode = null, public readonly ?string $providerMessage = null, public readonly ?array $response = null, ) { } /** * @param array|null $response */ public static function success( string $provider, ?string $requestId = null, ?string $providerCode = null, ?string $providerMessage = null, ?array $response = null, ): self { return new self(true, $provider, $requestId, $providerCode, $providerMessage, $response); } /** * @param array|null $response */ public static function failure( string $provider, ?string $requestId = null, ?string $providerCode = null, ?string $providerMessage = null, ?array $response = null, ): self { return new self(false, $provider, $requestId, $providerCode, $providerMessage, $response); } }