Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

checkAvailability($domain, $module_row_id = null)

(required) The checkAvailability() method is called when an availability check is made for a domain from an order form. It must return true if the domain is available or false otherwise.  If this is not implemented then all domains will be considered available by the module.

Code Block
languagephp
class MyModule extends RegistrarModule {
...
	public function checkAvailability($domain, $module_row_id = null)
    {
        $row = $this->getModuleRow($module_row_id);
        $api = $this->getApi(...);

		// Check if the domain is available (this is dependent on the module's API, omitted here)
		$domain = $api->checkDomain($domain);

		return isset($domain->availability) ? $domain->availability : false;
	}
...
}

getServiceDomain($service)

(optional) Registrar modules should use the 'domain' key for their domain field, but if they choose something different, this method can be overridden to get the domain from the appropriate service field.

...

getExpirationDate($service, $format = 'Y-m-d H:i:s')

(optional) The getExpirationDate() method is called by the Domain Manager plugin to synchronize the expiration date of the domain with the renewal date of the service.

...

getTlds($module_row_id = null)

(required) The getTlds() method returns a list of the TLDs supported by the registrar module. Without implementing this method the module will not support any TLDs.

Code Block
languagephp
class MyModule extends RegistrarModule {
...
	public function getTlds($module_row_id = null) {
		return [
			'.com',
			'.net',
			'.org'
		];
	}
...
}

...