RegisterContacts
%Plugin_Name%_RegisterContacts
Purpose
Use this function to register domain's contacts.
Input Parameters
configarray: an array of parameters defined during the plugin configuration.tld: a top-level domain name.sld: a second-level domain name.contactdetails: contact information, an array containing the following elements:RegistrantAdminTechBillingFirst NameMiddle NameLast Namecountrycompanypostcodecitystatestatenameaddress1address2EmailphonenumberFaxbirthdate.phonenumberseparated: an associative array containing the following data:countryCodeareaCodenumberext
faxseparated: an associative array containing the following data:countryCodeareaCodenumberext
each of which is an associative array of the following elements:
additionalfields: supplementary data for further domain processing.
Return Parameters
Method returns either nothing, or the following parameter:
additionalfields(optional): supplementary data for further domain processing.
Mandatory
No
Example
function Example_RegisterContacts($params) {
$sld = $params["sld"];
$tld = $params["tld"];
$registrant = $params["contactdetails"]["Registrant"];
$owner["first_name"] = $registrant["First Name"];
$owner["last_name"] = $registrant["Last Name"];
$owner["org_name"] = $registrant["company"];
$phone = $registrant["phonenumberseparated"];
$owner["phone"] = $phone["countryCode"].$phone["areaCode"].$phone["number"].$phone["ext"];
$fax = $registrant["faxseparated"];
$owner["fax"] = $fax["countryCode"].$fax["areaCode"].$fax["number"].$fax["ext"];
$owner["email"] = $registrant["Email"];
$owner["postal_code"] = $registrant["postcode"];
$owner["country"] = $registrant["country"];
$owner["state"] = $registrant["state"];
$owner["city"] = $registrant["city"];
$owner["address1"] = $registrant["address1"];
$owner["address2"] = $registrant["address2"];
// The same information for Technical, Billing and Admin contacts
$billing = $params["contactdetails"]["Billing"];
$tech = $params["contactdetails"]["Tech"];
$admin = $params["contactdetails"]["Admin"];
// $response = $api->registerContacts($owner);
return array(
"additionalfields" => array(
"RegistrantContactID" => $response["contactid1"],
"AdminContactID" => $response["contactid2"],
"TechContactID" => $response["contactid3"],
"BillingContactID" => $response["contactid4"],
)
);
}