diff --git a/composer.json b/composer.json index 84ac743..5a4adac 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "internetx/php-domainrobot-sdk", - "version": "0.9.19", + "version": "0.9.21", "description": "A php package for easy integration of the domainrobot API powered by InterNetX GmbH.", "type": "library", "license": "MIT", diff --git a/src/Domainrobot.php b/src/Domainrobot.php index b684353..62af60d 100644 --- a/src/Domainrobot.php +++ b/src/Domainrobot.php @@ -4,11 +4,12 @@ use Domainrobot\Lib\DomainrobotConfig; use Domainrobot\Service\CertificateService; +use Domainrobot\Service\ContactService; +use Domainrobot\Service\DocumentService; use Domainrobot\Service\DomainStudioService; use Domainrobot\Service\DomainService; use Domainrobot\Service\DomainBulkService; use Domainrobot\Service\SslContactService; -use Domainrobot\Service\ContactService; use Domainrobot\Service\DomainCancelationService; use Domainrobot\Service\TransferOutService; use Domainrobot\Service\TrustedApplicationService; @@ -24,6 +25,7 @@ use Domainrobot\Service\LoginService; use Domainrobot\Service\DomainPremiumService; use Domainrobot\Service\RedirectService; + class Domainrobot { // private static $instance = null; @@ -50,6 +52,13 @@ class Domainrobot */ public $contact; + /** + * Interface for all document related requests + * + * @var DomainService + */ + public $document; + /** * Interface for all domain related requests * @@ -196,6 +205,7 @@ public function __construct($domainrobotConfig = []) $this->setDomainrobotConfig(new DomainrobotConfig($domainrobotConfig)); $this->certificate = new CertificateService($this->domainrobotConfig); $this->contact = new ContactService($this->domainrobotConfig); + $this->document = new DocumentService($this->domainrobotConfig); $this->domain = new DomainService($this->domainrobotConfig); $this->domainBulk = new DomainBulkService($this->domainrobotConfig); $this->domainCancelation = new DomainCancelationService($this->domainrobotConfig); diff --git a/src/Service/DocumentService.php b/src/Service/DocumentService.php new file mode 100644 index 0000000..ed71b7d --- /dev/null +++ b/src/Service/DocumentService.php @@ -0,0 +1,32 @@ +infoAsync($id); + $domainrobotResult = $domainrobotPromise->wait(); + + return $domainrobotResult; + } + + /** + * Sends a contact info request. + * + * @param int $id + * @return DomainrobotPromise + */ + public function infoAsync($id) + { + return $this->sendRequest( + $this->domainrobotConfig->getUrl() . "/document/$id", + 'GET' + ); + } +}