public function transferDomain(Registrar_Domain $domain) { $c = $domain->getContactRegistrar(); $params = array('domain' => $domain->getName()); // Set contact data foreach (array('Registrant', 'Admin', 'Technical', 'Billing') as $contactType) { $params[$contactType . '_Organization'] = $c->getCompany(); $params[$contactType . '_FirstName'] = $c->getFirstName(); $params[$contactType . '_LastName'] = $c->getLastName(); $params[$contactType . '_Email'] = $c->getEmail(); $params[$contactType . '_PhoneNumber'] = '+' . $c->getTelCc() . '.' . $c->getTel(); $params[$contactType . '_Street'] = $c->getAddress1(); $params[$contactType . '_Street2'] = $c->getAddress2(); $params[$contactType . '_Street3'] = $c->getAddress3(); $params[$contactType . '_City'] = $c->getCity(); $params[$contactType . '_CountryCode'] = $c->getCountry(); $params[$contactType . '_PostalCode'] = $c->getZip(); $params[$contactType . '_Language'] = 'en'; } $result = $this->_process('/Domain/Transfer/Initiate', $params); return $result['status'] == 'SUCCESS'; }
public function getContactIdForDomain(Registrar_Domain $domain) { $c = $domain->getContactRegistrar(); $customer = $this->_getCustomerDetails($domain); $customer_id = $customer['customerid']; $tld = $domain->getTld(); $contact = array('customer-id' => $customer_id, 'type' => 'Contact', 'email' => $c->getEmail(), 'name' => $c->getName(), 'company' => $c->getCompany(), 'address-line-1' => $c->getAddress1(), 'address-line-2' => $c->getAddress2(), 'city' => $c->getCity(), 'state' => $c->getState(), 'country' => $c->getCountry(), 'zipcode' => $c->getZip(), 'phone-cc' => $c->getTelCc(), 'phone' => $c->getTel()); if ($tld == '.uk') { $contact['type'] = 'UkContact'; } if ($tld == '.eu') { $contact['type'] = 'EuContact'; } if ($tld == '.cn') { $contact['type'] = 'CnContact'; } if ($tld == '.ca') { $contact['type'] = 'CaContact'; } if ($tld == '.de') { $contact['type'] = 'DeContact'; } if ($tld == '.es') { $contact['type'] = 'EsContact'; } if ($tld == '.ru') { $contact['type'] = 'RuContact'; } $id = $this->_makeRequest('contacts/add', $contact, 'POST'); return $id; }
public function registerDomain(Registrar_Domain $domain) { $c = $domain->getContactRegistrar(); $params = array('domain' => $domain->getName(), 'period' => $domain->getRegistrationPeriod() . 'Y'); // Add nameservers $nsList = array(); $nsList[] = $domain->getNs1(); $nsList[] = $domain->getNs2(); if ($domain->getNs3()) { $nsList[] = $domain->getNs3(); } if ($domain->getNs4()) { $nsList[] = $domain->getNs4(); } $params['ns_list'] = implode(',', $nsList); // Set contact data foreach (array('Registrant', 'Admin', 'Technical', 'Billing') as $contactType) { $params[$contactType . '_Organization'] = $c->getCompany(); $params[$contactType . '_FirstName'] = $c->getFirstName(); $params[$contactType . '_LastName'] = $c->getLastName(); $params[$contactType . '_Email'] = $c->getEmail(); $params[$contactType . '_PhoneNumber'] = '+' . $c->getTelCc() . '.' . $c->getTel(); $params[$contactType . '_Street'] = $c->getAddress1(); $params[$contactType . '_Street2'] = $c->getAddress2(); $params[$contactType . '_Street3'] = $c->getAddress3(); $params[$contactType . '_City'] = $c->getCity(); $params[$contactType . '_CountryCode'] = $c->getCountry(); $params[$contactType . '_PostalCode'] = $c->getZip(); $params[$contactType . '_Language'] = 'en'; } if ($domain->getTld() == '.asia') { $params['Registrant_DotAsiaCedLocality'] = $c->getCountry(); $params['Registrant_DotAsiaCedEntity'] = 'naturalPerson'; $params['Registrant_DotAsiaCedIdForm'] = 'passport'; } if ($domain->getTld() == '.fr' || $domain->getTld() == '.re') { $tm = rand(100000000, 999999999); $params['registrant_dotFRContactEntityType'] = 'OTHER'; $params['admin_dotFRContactEntityType'] = 'OTHER'; $params['registrant_dotFRContactEntityName'] = $c->getName(); $params['admin_dotFRContactEntityName'] = $c->getName(); $params['registrant_dotFROtherContactEntity'] = $c->getName(); $params['admin_dotFROtherContactEntity'] = $c->getName(); $params['registrant_dotFRContactEntityTrademark'] = $tm; $params['admin_dotFRContactEntityTrademark'] = $tm; } if ($domain->getTld() == '.it') { $params['Registrant_dotitEntityType'] = 1; $params['Registrant_dotitNationality'] = $c->getCountry(); $params['Registrant_dotitRegCode'] = $c->getDocumentNr(); $params['Registrant_dotitHideWhois'] = $domain->getPrivacyEnabled() ? 'YES' : 'NO'; $params['Registrant_dotitProvince'] = $c->getState(); for ($i = 1; $i < 5; $i++) { $params['Registrant_dotItTerm' . $i] = 'YES'; } $params['Registrant_clientIp'] = '1.1.1.1'; $params['Admin_dotitProvince'] = $c->getState(); $params['Technical_dotitProvince'] = $c->getState(); } if ($domain->getTld() == '.us') { $params['Registrant_usPurpose'] = 'P3'; $params['Registrant_usNexusCategory'] = 'C11'; } $result = $this->_process('/Domain/Create', $params); return $result['product_0_status'] == 'PENDING' || $result['product_0_status'] == 'SUCCESS'; }
public function registerDomain(Registrar_Domain $domain) { $c = $domain->getContactRegistrar(); $params = array('domain' => $domain->getName(), 'years' => 1, 'fn' => $c->getFirstName(), 'ln' => $c->getLastName(), 'ad' => $c->getAddress1(), 'ad2' => $c->getAddress2(), 'cy' => $c->getCity(), 'st' => $c->getState(), 'zp' => $c->getZip(), 'ct' => $c->getCountry(), 'em' => $c->getEmail(), 'ph' => $c->getTel()); $i = 0; foreach ($domain->getNameservers() as $ns) { $params['ns' . $i] = $ns->getHost(); } $result = $this->_request('registerDomain', $params); return true; }
/** * @param Registrar_Domain $domain * @return bool * @throws Registrar_Exception * @see https://www.namesilo.com/api_reference.php#registerDomain */ public function registerDomain(Registrar_Domain $domain) { $c = $domain->getContactRegistrar(); $params = array('domain' => $domain->getName(), 'years' => $domain->getRegistrationPeriod(), 'fn' => $c->getFirstName(), 'ln' => $c->getLastName(), 'ad' => $c->getAddress1(), 'ad2' => $c->getAddress2(), 'cy' => $c->getCity(), 'st' => $c->getState(), 'zp' => $c->getZip(), 'ct' => $c->getCountry(), 'em' => $c->getEmail(), 'ph' => $c->getTel()); if ($domain->getName() == '.us') { $params['usnc'] = 'C12'; $params['usap'] = 'P3'; } $params['ns1'] = $domain->getNs1(); $params['ns2'] = $domain->getNs2(); if ($domain->getNs3()) { $params['ns3'] = $domain->getNs3(); } if ($domain->getNs4()) { $params['ns4'] = $domain->getNs4(); } $result = $this->_request('registerDomain', $params); return true; }
public function registerDomain(Registrar_Domain $domain) { $domainname = $domain->getName(); $enduseremail = $domain->getContactRegistrar()->getEmail(); $monthsofregistration = $domain->getRegistrationPeriod() * 12; $nameservers = array(); if ($domain->getNs1()) { $nameservers[] = $domain->getNs1(); } if ($domain->getNs2()) { $nameservers[] = $domain->getNs2(); } if ($domain->getNs3()) { $nameservers[] = $domain->getNs3(); } if ($domain->getNs4()) { $nameservers[] = $domain->getNs4(); } $result = $this->domainshare_register($domainname, $enduseremail, $monthsofregistration, $nameservers); return $result['status'] == 'DOMAIN REGISTERED'; }
/** * * Checks if SubAccount exists in reseller account * @param Registrar_Domain $d * @return bool */ private function _checkSubAcountExists(Registrar_Domain $d) { $c = $d->getContactRegistrar(); $email = $c->getEmail(); $username = $this->_getUsername($email); $params = array('command' => 'getsubaccounts', 'startletter' => $username); $result = $this->_makeRequest($params); if (isset($result->SubAccounts->SubAccount)) { $subaccounts = $result->SubAccounts->SubAccount; if (is_array($subaccounts)) { foreach ($subaccounts as $subaccount) { if (isset($subaccount->LoginID) && (string) $subaccount->LoginID == $username) { return true; } } } else { if (isset($subaccounts->LoginID) && (string) $subaccounts->LoginID == $username) { return true; } } } return false; }
public function getContactIdForDomain(Registrar_Domain $domain) { $c = $domain->getContactRegistrar(); $customer = $this->_getCustomerDetails($domain); $customer_id = $customer['customer_id']; $tld = $domain->getTld(); $contact = array('customer_id' => $customer_id, 'email' => $c->getEmail(), 'name' => $c->getName(), 'company' => $c->getCompany(), 'address_line_1' => $c->getAddress1(), 'address_line_2' => $c->getAddress2(), 'city' => $c->getCity(), 'state' => $c->getState(), 'country' => $c->getCountry(), 'zipcode' => $c->getZip(), 'tel_cc_no' => $c->getTelCc(), 'tel_cc' => $c->getTel(), 'country_code' => 'id'); $id = $this->_makeRequest("contacts/{$customer_id}/contacts", $contact, 'POST'); return $id; }
/** * Buat customer baru * @return boolean */ private function _createCustomer(Registrar_Domain $domain) { $c = $domain->getContactRegistrar(); $company = $c->getCompany(); if (!isset($company) || strlen(trim($company)) == 0) { $company = 'N/A'; } $phoneNum = $c->getTel(); $phoneNum = preg_replace("/[^0-9]/", "", $phoneNum); $phoneNum = substr($phoneNum, 0, 12); $params = array('email' => $c->getEmail(), 'password' => $c->getPassword(), 'name' => $c->getName(), 'company' => $company, 'address_line_1' => $c->getAddress1(), 'address_line_2' => $c->getAddress2(), 'city' => $c->getCity(), 'state' => $c->getState(), 'country_code' => $c->getCountry(), 'zipcode' => $c->getZip(), 'tel_cc_no' => $c->getTelCc(), 'tel_no' => $phoneNum); $optional_params = array('address_line_3' => '', 'alt_tel_cc_no' => '', 'alt_tel_no' => '', 'fax_cc_no' => '', 'fax_no' => '', 'mobile_cc_no' => '', 'mobile_no' => ''); $params = array_merge($optional_params, $params); $customer = $this->_makeRequest('customers', $params, 'post'); return array($customer); }
public function enablePrivacyProtection(Registrar_Domain $domain) { $params = array('Command' => 'namecheap.domains.getInfo', 'DomainName' => $domain->getName()); $respond = $this->_call($params); if ($respond === false) { return false; } $whoisguard_id = (string) $respond->CommandResponse->DomainGetInfoResult->Whoisguard->ID; $params = array('Command' => 'namecheap.whoisguard.enable', 'WhoisguardID' => $whoisguard_id, 'ForwardedToEmail' => $domain->getContactRegistrar()->getEmail()); $respond = $this->_call($params); if ($respond === false) { return false; } $status = $respond->CommandResponse->WhoisguardEnableResult->attributes(); if (strtolower($status['IsSuccess']) == 'true') { return true; } else { return false; } }