TransferDomain
%Plugin_Name%_TransferDomain
Purpose
This function is used to initiate transfer of a domain.
Input Parameters
configarray
– array of parameters defined during plug-in configuration.sld
– second-level domain name.tld
– top-level domain name.transfersecret
– secret key for domain transfer which is generated by domain registrar.nsX (ns1, ns2, ...)
– array of domain's nameservers.Owner Info
– associative array containing the following data:firstname
middlename
lastname
birthday
companyname
email
country
postcode
city
state
statename
address1
address2
phonenumber
fax
phonenumberseparated
– an associative array containing the following data:countryCode
areaCode
number
ext
faxseparated
– an associative array containing the following data:countryCode
areaCode
number
ext
-
Admin Info
– associative array.- Same fields as for owner info, but parameters names are prefixed with '
admin
', e.g.adminfirstname
.
- Same fields as for owner info, but parameters names are prefixed with '
-
Billing Info
– associative array.- Same fields as for owner info, but parameters names are prefixed with '
billing
', e.g.billingfirstname
.
- Same fields as for owner info, but parameters names are prefixed with '
-
Technical Info
– associative array.- Same fields as for owner info, but parameters names are prefixed with '
tech
', e.g.techfirstname
.
- Same fields as for owner info, but parameters names are prefixed with '
additionalfields
– supplementary data for further domain processing.
Note: If the Local Presence service is being enabled for a domain, CloudBlue Commerce passes the LOCAL_PRESENCE parameter with the value 1 in the additionalfields
parameter of the method request.
Return Parameters
The method returns either nothing or an associative array 'additionalfields'
containing the following data:
'key' => 'value'
– only strings allowed for both key
and value
.
Mandatory
No
Example
function Example_TransferDomain($params)
{
// Configuration data specified in Example_GetConfigArray()
$apiUsername = $params["Username"];
$apiKey = $params["Key"];
$apiMode = $params["Test Mode"];
$tld = $params["tld"];
$sld = $params["sld"];
$domainName = "$sld.$tld";
$period = $params["regperiod"];
$nameservers = array();
for ($i = 1; $i <= 5; $i++) {
if (isset($params['ns' . $i])) {
$nameservers[] = $params['ns' . $i];
}
}
// Additional domain fields returned by Example_ValidateAdditionalFields()
$extraFields = $params["additionalfields"];
$owner = array();
$billing = array();
$admin = array();
$tech = array();
$owner["first_name"] = $params["firstname"];
$owner["last_name"] = $params["lastname"];
$owner["org_name"] = $params["company"];
$owner["phone"] = $params["phonenumberseparated"];
$owner["fax"] = $params["faxseparated"];
$owner["email"] = $params["email"];
$owner["postal_code"] = $params["postcode"];
$owner["country"] = $params["country"];
$owner["state"] = $params["state"];
$owner["city"] = $params["city"];
$owner["address1"] = $params["address1"];
$owner["address2"] = $params["address2"];
$billing["first_name"] = $params["billingfirstname"];
// The rest of Billing contact fields are prefixed with "billing"
//$billing["last_name"] = $params["billinglastname"];
$admin["first_name"] = $params["adminfirstname"];
// The rest of Admin contact fields are prefixed with "admin"
//$admin["last_name"] = $params["adminlastname"];
$tech["first_name"] = $params["techfirstname"];
// The rest of Technical contact fields are prefixed with "tech"
//$tech["last_name"] = $params["techlastname"];
try {
// Make API calls here
} catch(Exception $e) {
// In case of errors
return array(
"error" => $e->getMessage(),
);
}
// It's possible to return additional data to be stored for this domain name
return array(
"additionalfields" => array(
"OrderID" => $response["orderid"],
),
"registrylock" => "locked"
);
}