diff --git a/Protocols/EPP/eppExtensions/it-extcon-1.0/eppData/itEppContact.php b/Protocols/EPP/eppExtensions/it-extcon-1.0/eppData/itEppContact.php new file mode 100644 index 00000000..93e84973 --- /dev/null +++ b/Protocols/EPP/eppExtensions/it-extcon-1.0/eppData/itEppContact.php @@ -0,0 +1,81 @@ +setConsentForPublishing($consentForPublishing); + $this->setRegistrant($entityType, $nationalityCode, $regCode); + } + + public function setConsentForPublishing($consent = false) + { + $this->consentForPublishing = $consent ? 1 : 0; + } + + public function getConsentForPublishing() + { + return $this->consentForPublishing; + } + + public function setRegistrantEntityType($entityType) + { + if (!in_array($entityType, $this->entityTypes)) { + throw new eppException(sprintf('The entity type: \'%s\' is invalid', $entityType)); + } + $this->registrantEntityType = $entityType; + } + + public function setRegistrantNationalityCode($nationalityCode) + { + if (!empty($nationalityCode)) { + $this->registrantNationalityCode = $nationalityCode; + } + } + + public function setRegistrantRegCode($regCode) + { + if (!empty($regCode)) { + $this->registrantRegCode = $regCode; + } + } + + public function setRegistrant($entityType, $nationalityCode, $regCode) + { + $this->setRegistrantEntityType($entityType); + $this->setRegistrantNationalityCode($nationalityCode); + $this->setRegistrantRegCode($regCode); + } + + public function getRegistrant() + { + return [ + 'entityType' => $this->registrantEntityType, + 'nationalityCode' => $this->registrantNationalityCode, + 'regCode' => $this->registrantRegCode + ]; + } +} \ No newline at end of file diff --git a/Protocols/EPP/eppExtensions/it-extcon-1.0/eppRequests/itEppCreateContactRequest.php b/Protocols/EPP/eppExtensions/it-extcon-1.0/eppRequests/itEppCreateContactRequest.php new file mode 100644 index 00000000..961556d9 --- /dev/null +++ b/Protocols/EPP/eppExtensions/it-extcon-1.0/eppRequests/itEppCreateContactRequest.php @@ -0,0 +1,56 @@ + + + true + + IT + 1 + BSSRCR78D03G674P + + + +*/ + +class itEppCreateContactRequest extends eppCreateContactRequest { + + /** + * itEppCreateContactRequest constructor. + * @param eppContact|null $createInfo + * @param string $contacttype + * @param string $language + * @throws eppException + */ + function __construct(itEppContact $createInfo) { + parent::__construct($createInfo); + $this->addContactExtension($createInfo); + $this->addSessionId(); + } + + /** + * @param object eppContact + */ + public function addContactExtension(itEppContact $createInfo) { + $this->addExtension('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); + $this->addExtension('xsi:schemaLocation', 'urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd'); + + $this->contactobject->setAttribute('xmlns:contact', 'urn:ietf:params:xml:ns:contact-1.0'); + $this->contactobject->setAttribute('xsi:schemaLocation', 'urn:ietf:params:xml:ns:contact-1.0 contact-1.0.xsd'); + + $create = $this->createElement('extcon:create'); + $create->setAttribute('xmlns:extcon', 'http://www.nic.it/ITNIC-EPP/extcon-1.0'); + $create->setAttribute('xsi:schemaLocation', 'http://www.nic.it/ITNIC-EPP/extcon-1.0 extcon-1.0.xsd'); + + $create->appendChild($this->createElement('extcon:consentForPublishing', $createInfo->getConsentForPublishing())); + + $registrant = $createInfo->getRegistrant(); + $registrantElement = $this->createElement('extcon:registrant'); + $registrantElement->appendChild($this->createElement('extcon:nationalityCode', $registrant['nationalityCode'])); + $registrantElement->appendChild($this->createElement('extcon:entityType', $registrant['entityType'])); + $registrantElement->appendChild($this->createElement('extcon:regCode', $registrant['regCode'])); + $create->appendChild($registrantElement); + + $this->getExtension()->appendChild($create); + } +} diff --git a/Protocols/EPP/eppExtensions/it-extcon-1.0/eppResponses/itEppInfoContactResponse.php b/Protocols/EPP/eppExtensions/it-extcon-1.0/eppResponses/itEppInfoContactResponse.php new file mode 100644 index 00000000..7a2b2a01 --- /dev/null +++ b/Protocols/EPP/eppExtensions/it-extcon-1.0/eppResponses/itEppInfoContactResponse.php @@ -0,0 +1,51 @@ +getContactPostalInfo(); + + $contact = new itEppContact($postalinfo, $this->getContactEmail(), $this->getContactVoice(), $this->getContactFax(), null, null, $this->getConsentForPublishing(), $this->getRegistrantEntityType(), $this->getRegistrantNationalityCode(), $this->getRegistrantRegCode()); + return $contact; + } + + public function isRegistrant() + { + return $this->queryPath('/epp:epp/epp:response/epp:extension/extcon:infData/extcon:registrant') ? true : false; + } + + public function getConsentForPublishing() + { + return (bool) $this->queryPath('/epp:epp/epp:response/epp:extension/extcon:infData/extcon:consentForPublishing'); + } + + public function getRegistrantEntityType() + { + return (int) $this->queryPath('/epp:epp/epp:response/epp:extension/extcon:infData/extcon:registrant/extcon:entityType'); + } + + public function getRegistrantNationalityCode() + { + return $this->queryPath('/epp:epp/epp:response/epp:extension/extcon:infData/extcon:registrant/extcon:nationalityCode'); + } + + public function getRegistrantRegCode() + { + return $this->queryPath('/epp:epp/epp:response/epp:extension/extcon:infData/extcon:registrant/extcon:regCode'); + } + + public function getRegistrant() + { + $registrant['nationalityCode'] = $this->getRegistrantNationalityCode(); + $registrant['entityType'] = $this->getRegistrantEntityType(); + $registrant['regCode'] = $this->getRegistrantRegCode(); + + return $registrant; + } +} \ No newline at end of file diff --git a/Protocols/EPP/eppExtensions/it-extcon-1.0/includes.php b/Protocols/EPP/eppExtensions/it-extcon-1.0/includes.php new file mode 100644 index 00000000..668e0a28 --- /dev/null +++ b/Protocols/EPP/eppExtensions/it-extcon-1.0/includes.php @@ -0,0 +1,9 @@ +addExtension('extcon-1.0', 'http://www.nic.it/ITNIC-EPP/extcon-1.0'); + +include_once(dirname(__FILE__) . '/eppData/itEppContact.php'); +include_once(dirname(__FILE__) . '/eppRequests/itEppCreateContactRequest.php'); +include_once(dirname(__FILE__) . '/eppResponses/itEppInfoContactResponse.php'); + +$this->addCommandResponse('Metaregistrar\EPP\itEppCreateContactRequest', 'Metaregistrar\EPP\eppCreateContactResponse'); +$this->addCommandResponse('Metaregistrar\EPP\eppInfoContactRequest', 'Metaregistrar\EPP\itEppInfoContactResponse'); diff --git a/Protocols/EPP/eppExtensions/it-extepp-2.0/eppResponses/itEppLoginResponse.php b/Protocols/EPP/eppExtensions/it-extepp-2.0/eppResponses/itEppLoginResponse.php new file mode 100644 index 00000000..c598b1e5 --- /dev/null +++ b/Protocols/EPP/eppExtensions/it-extepp-2.0/eppResponses/itEppLoginResponse.php @@ -0,0 +1,21 @@ +queryPath('/epp:epp/epp:response/epp:extension/extepp:creditMsgData/extepp:credit'); + } +} \ No newline at end of file diff --git a/Protocols/EPP/eppExtensions/it-extepp-2.0/includes.php b/Protocols/EPP/eppExtensions/it-extepp-2.0/includes.php new file mode 100644 index 00000000..c72f3a28 --- /dev/null +++ b/Protocols/EPP/eppExtensions/it-extepp-2.0/includes.php @@ -0,0 +1,6 @@ +addExtension('extepp-2.0', 'http://www.nic.it/ITNIC-EPP/extepp-2.0'); + +include_once(dirname(__FILE__) . '/eppResponses/itEppLoginResponse.php'); + +$this->addCommandResponse('Metaregistrar\EPP\eppLoginRequest', 'Metaregistrar\EPP\itEppLoginResponse');