Versions Compared

Key

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

...

The methods below are available for modules extending the RegistrarModule class.  

...

checkTransferAvailability($domain, $module_row_id = null)

(optional) The checkTransferAvailability() method is called when an availability check is made for a domain transfer from an order form. It must return true if the domain is available for transfer 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 checkTransferAvailability($domain, $module_row_id = null)
    {
        // If the domain is available for registration, then it is not available for transfer
        return !$this->checkAvailability($domain, $module_row_id);
	}
...
}

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;
	}
...
}

getDomainContacts($domain, $module_row_id = null)

(optional) Returns an array with all the contacts for a given domain.

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

		// Get the domain contacts (this is dependent on the module's API, omitted here)
		$contact = $api->getContact($domain);

		return [
            [
                'external_id' => $contact->id,
                'email' => $contact->email,
                'phone' => $contact->phone,
                'first_name' => $contact->firstName,
                'last_name' => $contact->lastName,
                'address1' => $contact->address1,
                'address2' => $contact->address2,
                'city' => $contact->city,
                'state' => $contact->state,
                'zip' => $contact->zip,
                'country' => $contact->country
            ]
        ];
	}
...
}

setDomainContacts($domain, array $vars = [], $module_row_id = null)

(optional) Updates the list of contacts associated with a domain.

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

		// Set the domain contacts (this is dependent on the module's API, omitted here)
		$contacts = $api->setContacts($domain);

		return ($contacts->status == 'success');
	}
...
}

getDomainInfo($domain, $module_row_id = null)

(optional) Gets a list of basic information for a domain.

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

		// Get the domain information (this is dependent on the module's API, omitted here)
		$domain = $api->getInformation($domain);

		return (array) $domain;
	}
...
}

getDomainIsLocked($domain, $module_row_id = null)

(optional) Returns whether the domain has a registrar lock.

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

		// Get the domain information (this is dependent on the module's API, omitted here)
		$domain = $api->getInformation($domain);

		return ($domain->status == 'locked');
	}
...
}

getDomainNameServers($domain, $module_row_id = null)

(optional) Returns a list of name server data associated with the domain.

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

		// Get the domain information (this is dependent on the module's API, omitted here)
		$domain = $api->getInformation($domain);

		return $domain->name_servers;
	}
...
}

setDomainNameservers($domain, $module_row_id = null, array $vars = [])

(optional) Assigns new name servers to the domain.

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

		// Set the domain name servers (this is dependent on the module's API, omitted here)
		$nameservers = $api->setNameservers($vars);

		return ($nameservers->status == 'success');
	}
...
}

lockDomain($domain, $module_row_id = null)

(optional) Locks the domain.

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

		// Set the domain status (this is dependent on the module's API, omitted here)
		$status = $api->setStatus($domain, 'locked');

		return ($nameservers->status == 'success');
	}
...
}

unlockDomain($domain, $module_row_id = null)

(optional) Unlocks the domain.

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

		// Set the domain status (this is dependent on the module's API, omitted here)
		$status = $api->setStatus($domain, 'active');

		return ($nameservers->status == 'success');
	}
...
}

registerDomain($domain, $module_row_id = null, array $vars = [])

(required) Register a new domain with the registrar.

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

		// Register the new domain (this is dependent on the module's API, omitted here)
		$domain = $api->newDomain($domain, $vars);

		return ($domain->status == 'success');
	}
...
}

transferDomain($domain, $module_row_id = null, array $vars = [])

(optional) Transfers the domain to a new registrar.

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

		// Transfer the domain (this is dependent on the module's API, omitted here)
		$transfer = $api->transferDomain($domain, $vars['epp_code'], $vars);

		// Send confirmation email
		$this->resendTransferEmail($domain, $module_row_id);

		return ($transfer->status == 'pending');
	}
...
}

resendTransferEmail($domain, $module_row_id = null)

(optional) Resends the domain transfer verification email.

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

		// Send transfer email (this is dependent on the module's API, omitted here)
		$transfer = $api->sendTransferEmail($domain);

		return ($transfer->status == 'success');
	}
...
}

sendEppEmail($domain, $module_row_id = null)

(optional) Sends the domain transfer auth code to the admin email.

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

		// Send transfer email (this is dependent on the module's API, omitted here)
		$transfer = $api->sendTransferEmail($domain);

		return ($transfer->status == 'success');
	}
...
}

updateEppCode($domain, $epp_code, $module_row_id = null, array $vars = [])

(optional) Updates the EPP code (Authorization Code) of the domain.

Code Block
languagephp
class MyModule extends RegistrarModule {
...
    public function updateEppCode($domain, $epp_code, $module_row_id = null, array $vars = [])
    {
        $row = $this->getModuleRow($module_row_id);
        $api = $this->getApi(...);

		// Update the domain EPP code (this is dependent on the module's API, omitted here)
		$domain = $api->updateDomain($domain, ['auth_code' => $epp_code]);

		return ($domain->status == 'success');
	}
...
}

renewDomain($domain, $module_row_id = null, array $vars = [])

(required) Renews the domain with the registrar.

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

		// Renew domain (this is dependent on the module's API, omitted here)
		$domain = $api->renewDomain($domain, $vars);

		return ($domain->status == 'success');
	}
...
}

restoreDomain($domain, $module_row_id = null, array $vars = [])

(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 Restores the domain through the registrar.

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

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

		return isset($domain->availability)>status ? $domain->availability : false== 'success');
	}
...
}

getServiceDomain($service)

...