Sync
%Plugin_Name%_Sync
Purpose
Use this function to:
- check domain registration status
- request domain information
Input Parameters
configarray: an array of parameters defined during plugin configuration.tld: a top-level domain name.sld: a second-level domain name.additionalfields: supplementary data for further domain processing.details: domain information request only.If the
detailsparameter isfalse, the function checks whether a domain registration is completed or not, and then returns the appropriate status.If the
detailsparameter istrue, the function receives domain details and then returns them.The function is called with the
details=falseparameter only for a domain registration; it can be called with thedetails=trueparameter at any time.
Return Parameters
completed: eithertrueif the operation is successfully completed, orfalseif the operation is in progress. Iffalse, the method must be called again until eithertrueis received or an error occurs.expirydate: the domain expiration date; it is optional if thedetailsinput parameter isfalse, and it is mandatory if thedetailsinput parameter istrue.additionalfields(optional): supplementary data for further domain processing.conflictcode(optional): domain data conflict code (integer). This parameter is returned if there is a conflict between domain data in CloudBlue Commerce and domain data in a registrar system. Unless the plugin is programmed to return one of the reserved conflict codes, we recommend that the code returned by the registrar system be passed.conflictmessage(optional): conflict message (string). This parameter is returned if theconflictcodeparameter is returned for better understanding of the conflict nature. The conflict message is displayed in the PCP.
Mandatory
No
Example
function Example_Sync($params)
{
$sld = $params["sld"];
$tld = $params["tld"];
// Restore OrderID which was previously saved by Example_RegisterDomain()
$orderID = $params['additionalfields']['OrderID'];
// Check if domain has been registered
// $domainInfo = $api->getOrderInfo($orderID);
$result = array(
"completed" => true,
"expirydate" => $domainInfo["expirydate"],
"conflictcode" => "103", //optional
"conflictmessage" => "Domain has been transferred out!", //optional
);
// Return "completed" => false in case of pending status
// return array("completed" => false);
}