This will hold the complete contact info a registry can receive and give you
/**
 * @param $conn eppConnection
 * @param $email string
 * @param $telephone string
 * @param $name string
 * @param $organization string
 * @param $address string
 * @param $postcode string
 * @param $city string
 * @param $country string
 * @return null
 */
function createcontact($conn, $email, $telephone, $name, $organization, $address, $postcode, $city, $country)
{
    $postalinfo = new eppContactPostalInfo($name, $city, $country, $organization, $address, null, $postcode);
    $contactinfo = new eppContact($postalinfo, $email, $telephone);
    $contactinfo->setPassword('');
    $contact = new eppCreateContactRequest($contactinfo);
    if ($response = $conn->request($contact)) {
        /* @var $response Metaregistrar\EPP\eppCreateContactResponse */
        echo "Contact created on " . $response->getContactCreateDate() . " with id " . $response->getContactId() . "\n";
        return $response->getContactId();
    } else {
        echo "Create contact failed";
    }
    return null;
}
function createcontact($conn, $email, $telephone, $name, $organization, $address, $postcode, $city, $country)
{
    /* @var $conn Metaregistrar\EPP\eppConnection */
    try {
        $contactinfo = new eppContact(new eppContactPostalInfo($name, $city, $country, $organization, $address, null, $postcode, Metaregistrar\EPP\eppContact::TYPE_LOC), $email, $telephone);
        $contactinfo->setPassword('fubar');
        $contact = new eppCreateContactRequest($contactinfo);
        if ($response = $conn->request($contact)) {
            /* @var $response Metaregistrar\EPP\eppCreateContactResponse */
            echo "Contact created on " . $response->getContactCreateDate() . " with id " . $response->getContactId() . "\n";
            return $response->getContactId();
        }
    } catch (eppException $e) {
        echo $e->getMessage() . "\n";
    }
    return null;
}
Пример #3
0
function createcontact($conn, $email, $telephone, $name, $organization, $address, $postcode, $city, $country)
{
    /* @var $conn Metaregistrar\EPP\eppConnection */
    try {
        $contactinfo = new eppContact(new eppContactPostalInfo($name, $city, $country, $organization, $address, null, $postcode, eppContact::TYPE_LOC), $email, $telephone);
        // Ficora will not accept a password field in the request
        $contactinfo->setPassword(null);
        $contact = new ficoraEppCreateContactRequest($contactinfo);
        $contact->setRole(ficoraEppCreateContactRequest::FI_CONTACT_ROLE_TECHNICAL);
        $contact->setType(ficoraEppCreateContactRequest::FI_CONTACT_TYPE_COMPANY);
        $contact->setIsfinnish(false);
        $contact->setFirstname('Ewout');
        $contact->setLastname('de Graaf');
        $contact->setBirthdate('2005-04-03 22:00');
        $contact->setRegisternumber('1234312-5');
        $contact->setIdentity('123423A123F');
        $contact->setLegalemail($contactinfo->getEmail());
        if ($response = $conn->request($contact)) {
            /* @var $response Metaregistrar\EPP\eppCreateContactResponse */
            echo "Contact created on " . $response->getContactCreateDate() . " with id " . $response->getContactId() . "\n";
            return $response->getContactId();
        }
    } catch (eppException $e) {
        echo $e->getMessage() . "\n";
        echo $e->getLastCommand() . "\n";
    }
    return null;
}