A domain registrar plugin allows Clientexec to automatically register, renew and manage domain names.
We have created a sample domain registrar module that should be used as a starting point: https://github.com/clientexec/sample-registrar
Naming Convention
The name of the plugin directory MUST be all lower case, and alphanumeric, such as sample.
The name of the plugin file, and the plugin class MUST start with Plugin, followed by the name of the directory with ONLY the first letter capitalized, such as PluginSample
Features
Each domain registrar plugin can define certain features to be available or not.
- nameSuggest - If the domain registrar supports name suggestions.
- importDomains - If this plugin can import already registered domains from the domain registrar.
- importPrices - If this plugin can import TLDs and prices from the domain registrar.
public $features = [ 'nameSuggest' => true, 'importDomains' => true, 'importPrices' => true, ];
Configuration
Each domain registrar plugin must have a getVariables() function which will define certain options. The function must return an array of values.
public function getVariables() { $variables = [ 'Name' => [ 'type' => 'hidden', 'description' => 'Used by CE to show plugin', 'value' => 'Sample' ], 'Description' => [ 'type' => 'hidden', 'description' => 'Description viewable by admin in server settings', 'value' => 'Sample Server Plugin' ], 'Text Field' => [ 'type' => 'text', 'description' => 'Text Field Description', 'value' => 'Default Value', ], 'Encrypted Text Field' => [ 'type' => 'text', 'description' => 'Encrypted Text Field Description', 'value' => '', 'encryptable' => true ], 'Password Text Field' => [ 'type' => 'password', 'description' => 'Encrypted Password Field Description', 'value' => '', 'encryptable' => true ], 'Text Area' => [ 'type' => 'textarea', 'description' => 'Text Area Description', 'value' => 'Default Value', ], 'Yes / No' => [ 'type' => 'yesno', 'description' => 'Yes / No Description', 'value' => '1', ], 'Actions' => [ 'type' => 'hidden', 'description' => 'Current actions that are active for this plugin (when a domain isn\'t registered)', 'value'=>'Register' ], 'Registered Actions' => [ 'type' => 'hidden', 'description' => 'Current actions that are active for this plugin (when a domain is registered)', 'value'=>'Renew (Renew Domain),DomainTransferWithPopup (Initiate Transfer),SendTransferKey (Send Auth Info),Cancel' ], 'Registered Actions For Customer' => [ 'type' => 'hidden', 'description' => 'Current actions that are active for this plugin (when a domain is registered)', 'value' => 'SendTransferKey (Send Auth Info)' ] ]; return $variables; }
Error Handling
Throwing a CE_Exception will display the error message to the client/admin.
Functions
The following is a list of minimal functions for a domain registrar plugin. Additional functions may be created, and assigned to the "Actions" (for admin) or "Registered Actions For Customer" (for client side) array.