Domain Syncronisation
The domain syncronisation functions allow you to propagate any domain expiry date and status changes at the registry level to WHASOLS. This is particularly useful for domain transfers where completion of the transfer and expiry dates can not be known by WHASOLS automatically without it.
Domain Syncing
Domain syncing is performed in batches. When defined in your module, the Sync function will be called for 100 domains on a rolling basis each time the domain sync cron is invoked. After all of the domains that are assigned to your module have been synced, it will start from the beginning again.
Domains are only checked when they are in Active or Pending Transfer status.
The below example shows the supported return values for the function.
<?php function yourmodule_Sync($params) {
/**
* Available parameters include the following.
* Any settings defined in your Config Options method will also be available.
*/
$params['domainid'];
$params['domain'];
$params['sld'];
$params['tld'];
$params['registrar'];
$params['regperiod'];
$params['status'];
$params['dnsmanagement'];
$params['emailforwarding'];
$params['idprotection'];
// Perform code to fetch domain status here
// Return your result.
// If 'error' is returned, all other values will be ignored. It is important to ensure 'error' is not returned in this array
// unless the sync should not be completed. The error message will be provided in the "Domain Synchronisation Report" email.
return [
'status'=>'success',//success or error will be here
'message' => 'Error message goes here.' // The error message returned here will be returned within the Domain Synchronisation Report Email
'active' => true, // Return true if the domain is active
'cancelled' => false, // Return true if the domain has been cancelled
'expired' => false,//return true if the domain has been expired
'transferredAway' => false, // Return true if the domain has been transferred away from this registrar
'expirydate' => '2022-07-11', // Return the current expiry date for the domain
];
}
Settings relating to domain syncing are in
Configuration > Automation Settings
. There are 3 key settings:- Domain Sync Enabled - Check to allow the domain sync cron to actually run.
- Sync Next Due Date - Enable this setting to update next due date to match the expiry field as part of the sync.
- Domain Sync Notify Only - Enable this to allow WHASOLS to run the sync checks and report any inconsistencies. But, no changes to the domains will occur. With this enabled you receive an email report listing any discrepancies between the registrar and WHASOLS.
Transfer Syncing
Transfer syncing works in a similar way to domain syncing. When defined in your module, this function will be called for every domain in the Pending Transfer status when the domain sync cron runs.
The Transfer Sync method supports a number of return values. A completed status indicator, the expiry date, a failed state, and a failure reason. The below code example demonstrates the use of these.
<?php function yourmodule_TransferSync($params) {
/**
* Available parameters include the following.
* Any settings defined in your Config Options method will also be available.
*/
$params['domainid'];
$params['domain'];
$params['sld'];
$params['tld'];
$params['registrar'];
$params['regperiod'];
$params['status'];
$params['dnsmanagement'];
$params['emailforwarding'];
$params['idprotection'];
// Perform code to fetch domain status here
// Return your result.
// If 'error' is returned, all other values will be ignored. It is important to ensure 'error' is not returned in this array
// unless the sync should not be completed. The error message will be provided in the "Domain Synchronisation Report" email.
return [
'status'=>'success',//success or error will be here
'message' => 'Error message goes here.' // The error message returned here will be returned within the Domain Synchronisation Report Email
'active' => true, // Return true if the domain is active
'cancelled' => false, // Return true if the domain has been cancelled
'expired' => false,//return true if the domain has been expired
'transferredAway' => false, // Return true if the domain has been transferred away from this registrar
'expirydate' => '2022-07-11', // Return the current expiry date for the domain
];
}