Jump to content

Transfer syncing in WHMCS


Recommended Posts

Hello.

I have a few questions about transfer sync: https://developers.whmcs.com/domain-registrars/domain-syncing/

I see that there's an option to set 'failed' => true, but what does this mean?

return array(
        'completed' => true, // Return as true upon successful completion of the transfer
        'expirydate' => '2017-10-15', // The expiry date of the domain
        'failed' => false, // Return as true when transfer fails permenantly
        'reason' => 'Reason message can go here', // Reason for the transfer failure if available
        'error' => 'Error message goes here', // If the check fails, an error message string can be provided here
    );

What does 'permanently' mean? Will it only fail after X number of tries?

Link to comment
Share on other sites

I know this doesn't help, but "permenantly" in their code has a typo. Should be "permanantly", with an "a". 😉

The failed is for when the registrar can't complete the transfer and gives up. Domain locked, didn't get the auth from the owner and so on. 

Edited by bear
Link to comment
Share on other sites

23 minutes ago, bear said:

The failed is for when the registrar can't complete the transfer and gives up. Domain locked, didn't get the auth from the owner and so on. 

Darn. For .dk domains, you don't transfer the domain - you just change the name servers. There's no API for this, and the transfer will never fail. I might just instead do some custom code to check if the order data is older than 4 days, and fail if it is.

Link to comment
Share on other sites

Was actually not that difficult:

$registrationDate = Capsule::table('tbldomains')
    ->select('registrationdate')
    ->where('id', '=', $params['domainid'])
    ->first();

$date = new DateTime($registrationDate->registrationdate);
$now  = new \DateTime();

if *code that checks if transfer is successful*{
	return array(
		'completed' => true,
	);
} 
// Cancel the domain transfer if name servers aren't updated within 4 days
elseif($date->diff($now)->days > 4){
	return array(
		'failed' => true,
		'reason' => 'Client did not accept change of nameservers within 4 days',
	);
}
// If the nameservers for the domain hasn't been updated, but the transfer was initiated less than 4 days ago, show this error in the Transfer Sync email
else{
	return array(
		'error' => "Nameservers not updated",
	);
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated