Currently, you are able to create two types of custom modules: Payment and Registry.
The latest EPP-DRS API reference, generated with PHPDoc is available here
Payment module is a bridge between EPP-DRS and payment proccessing service.
See EPP-DRS payment modules API for more information.
Registry module communicate with a registry or SRS to register, renew domains, create contacts and hosts etc.
See EPP-DRS registry modules API (RAPI) for more information.
To help you integrate EPP-DRS with your existing environment, we created event handlers. Event handlers allow you to react to different EPP-DRS internal events. For example, you can execute your own PHP code when new client is created or before domain is created or when new invoice is issued.
See Creating Custom Event Handlers for more information.
Sections below describe object model and programming techniques that are common to all EPP-DRS APIs.
To log a message to system log, use the following code:
Log::Log($message, $severity);
Possible values for $severity are E_ERROR, E_WARNING, E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE.
Depending on severity, log entries are displayed differently in log viewer.
In case of E_ERROR, log entry will also contain execution backtrace.
You can either throw Exception or CustomException. These are actually equal, because CustomException is thrown on all uncaught exceptions via set_exception_handler().
Exception will add a record to log with severity E_USER_ERROR and draw templates/exception.tpl template.
When thrown in Control panels (CONTEXTS::$APPCONTEXT = APPCONTEXT::REGISTRANT_CP or CONTEXTS::$APPCONTEXT = APPCONTEXT::REGISTRAR_CP), it will draw templates/exception_cp.tpl template.
if (false == true) throw new CustomException("This will appear inside grey box surrounded by red border.");
System configuration parameters are taken from database, config.ini. Some parameters are hard-coded.
You can access most of them via global CONFIG enumerator.
Here is a sample:
// $currency will be assigned a value of current currency symbol. $currency = CONFIG::$CURRENCY;
You can use CONTEXTS::APPCONTEXT constant to retreive current application context in your code.
The value is one of http://webta.net/docs/epp-drs/phpdoc/Common/APPCONTEXT.html members.
Here is a sample:
switch (CONTEXTS:APPCONTEXT) { case APPCONTEXT::ORDERWIZARD : echo("We are in order wizard"); break; case APPCONTEXT::REGISTRANT_CP : echo ("We are in /client"); break; case APPCONTEXT::REGISTRAR_CP : echo ("We are in /admin"); break; default: echo ("Context not defined yet"); break; }
The following functions are not allowed in module code:
The following class names are not allowed in module code: