Exemplo n.º 1
0
 public function isDomainAvailable(Registrar_Domain $domain)
 {
     $this->getLog()->debug('Checking domain availability: ' . $domain->getName());
     if ($this->config['use_whois']) {
         $w = new Whois2($domain->getName());
         return $w->isAvailable();
     }
     throw new Registrar_Exception('Email registrar can not determine whether domain is available');
 }
Exemplo n.º 2
0
 public function testisDomainAvailable_isNotAvailable()
 {
     $adapterMock = $this->getMockBuilder('Registrar_Adapter_Resellerclub')->disableOriginalConstructor()->setMethods(array('_makeRequest'))->getMock();
     $registrarDomain = new Registrar_Domain();
     $registrarDomain->setSld('example')->setTld('.com');
     $requestResult = array($registrarDomain->getName() => array());
     $adapterMock->expects($this->atLeastOnce())->method('_makeRequest')->with('domains/available')->willReturn($requestResult);
     $result = $adapterMock->isDomainAvailable($registrarDomain);
     $this->assertFalse($result);
 }
Exemplo n.º 3
0
 private function _getDomainOrderId(Registrar_Domain $d)
 {
     $required_params = array('domain-name' => $d->getName());
     return $this->_makeRequest('domains/orderid', $required_params);
 }
Exemplo n.º 4
0
 /**
  * Checks whether privacy is enabled.
  * @param Registrar_Domain $domain
  * @return bool
  */
 private function _isPrivacyEnabled(Registrar_Domain $domain)
 {
     $params = array('domain' => $domain->getName());
     $result = $this->_process('/Domain/PrivateWhois/Status', $params);
     return $result['status'] == 'SUCCESS' && ($result['privatewhoisstatus'] == 'FULL' || $result['privatewhoisstatus'] == 'PARTIAL');
 }
Exemplo n.º 5
0
 public function togglePrivacyProtection(Registrar_Domain $domain)
 {
     $params = array('domain' => $domain->getName());
     $result = $this->_request('getDomainInfo', $params);
     $cmd = 'removePrivacy';
     if ((string) $result->reply->private == 'No') {
         $cmd = 'addPrivacy';
     }
     $this->_request($cmd, $params);
     return true;
 }
Exemplo n.º 6
0
 /**
  * @param Registrar_Domain $domain
  * @return bool
  * @throws Registrar_Exception
  * @see https://www.namesilo.com/api_reference.php#retrieveAuthCode
  */
 public function getEpp(Registrar_Domain $domain)
 {
     $params = array('domain' => $domain->getName());
     $result = $this->_request('retrieveAuthCode', $params);
     return 'EPP transfer code for the domain emailed to the administrative contact';
 }
Exemplo n.º 7
0
 public function deleteDomain(Registrar_Domain $domain)
 {
     $this->getLog()->debug('Removing domain: ' . $domain->getName());
     return true;
 }
 private function _getDomainOrderId(Registrar_Domain $d)
 {
     $required_params = array('domain_name' => $d->getName());
     $data = $this->_makeRequest('domains/details-by-name', $required_params);
     if (!isset($data['domain_id'])) {
         throw new Registrar_Exception('Domain not found');
     }
     return $data['domain_id'];
 }
Exemplo n.º 9
0
 public function unlock(Registrar_Domain $domain)
 {
     $this->getLog()->debug('Unlocking: ' . $domain->getName());
     return true;
 }
 /**
  * Cek domain sudah jadi belum
  * @return boolean
  */
 private function _hasCompletedOrder(Registrar_Domain $domain)
 {
     $domain_name = str_replace(" ", "", strtolower($domain->getName()));
     $param_search = http_build_query(array('limit' => '100', 'page_no' => '1', 'domain_name' => $domain_name, 'exact_domain_name' => '1'));
     $result_search = $this->_makeRequest('domains?' . $param_search);
     if (!empty($result_search) and is_array($result_search)) {
         foreach ($result_search as $res) {
             if (trim(strtolower($res['domain_name'])) == $domain_name) {
                 $domain_id = $res['domain_id'];
                 try {
                     $data = $this->_makeRequest('domains/' . $domain_id . '?fields=all');
                     return strtolower($data['order_status']) == 'live';
                 } catch (Registrar_Exception $e) {
                     return false;
                 }
             }
         }
     }
     return false;
 }
 public function unlock(Registrar_Domain $domain)
 {
     $params = array('Command' => 'namecheap.domains.setRegistrarLock', 'DomainName' => $domain->getName(), 'LockAction' => 'unlock');
     $respond = $this->_call($params);
     if ($respond === false) {
         return false;
     }
     $status = $respond->CommandResponse->DomainSetRegistrarLockResult->attributes();
     if (strtolower($status['IsSuccess']) == 'true') {
         return true;
     } else {
         return false;
     }
 }