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'; }