How domainreseller/whmcs-dna works
Project type and purpose
• This is a WHMCS “Registrar” module named DomainNameAPI.
• Its purpose is to plug into WHMCS (a PHP-based billing/automation platform) and provide domain registration, transfer, renewal, pricing and sync operations via the external DomainNameAPI SOAP service.
File structure
• Top-level: only this module under modules/registrars/domainnameapi.
• domainnameapi.php: the main module entry point exporting WHMCS registrar functions (config, register, transfer, renew, nameserver operations, pricing/TLD sync hooks).
• cache/: local response cache (for speed/reducing API calls).
• lib/: core client library (dna.php), plus Services/Language for loading localized messages.
• lang/: per-language message files.
• childns.tpl: the admin/customer template snippet for custom child nameserver UI.
• whmcs.json: module metadata (name, version, author).
README insights
• Describes installation into WHMCS directories, required PHP version and SOAP extension, user settings in WHMCS Admin.
• Walks through domain pricing config, TLD sync tools, error logs, and testing matrix.
• Mentions two external interactions: DomainNameAPI SOAP WSDL endpoint & WHMCS database.
Main components
a. WHMCS Core Platform
• UI Layer (Admin & Client Area pages)
• Module Loader / Registrar Manager
• MySQL Database (for storing domain records, pricing, sync state)
b. DomainNameAPI Module
• Configuration Definition (whmcs.json + config array in domainnameapi.php)
• Business Logic (domainnameapi.php functions: RegisterDomain, TransferDomain, RenewDomain, GetNameservers, EPP code, etc.)
• Template (childns.tpl)
• Cache Subsystem (cache/index.php for persisting API responses)
• Client Library (lib/dna.php)
• Localization Layer (Services/Language + lang/*.php)
c. External Service
• DomainNameAPI SOAP Web Service (WSDL endpoint)
Relationships and interactions
• WHMCS UI → invokes registrar functions in the module.
• Module Business Logic → loads config + localization → builds SOAP requests via dna.php → sends via PHP SOAPClient → receives response.
• Responses are parsed, optionally cached, then returned to WHMCS to update DB & show to user.
• Pricing/TLD Sync flows: Cron/Tools → module sync functions → compare & update WHMCS DB.
Architectural patterns & design principles
• Plugin Architecture: module is self-contained and invoked by WHMCS core hooks.
• Layered Design: UI templates, orchestration layer (domainnameapi.php), service client, caching, localization.
• Adapter Pattern: dna.php adapts between WHMCS data structures and the external SOAP API.
• Configuration-Driven: whmcs.json + dynamic config fields drive behavior.
Technologies & frameworks
• PHP 7.4+ with SOAP extension
• WHMCS Module API
• SOAP Web Service (WSDL)
• File-based caching
• Smarty templates (childns.tpl)
Essential details to capture
• All major registrar operations (Register, Transfer, Renew, EPP, Nameservers, Availability, Price Sync, TLD Sync)
• Caching layer between module and API
• Localization loading before operation
• Module metadata and config driving UI/logic
• External dependency on SOAP WSDL endpoint
• Integration points with WHMCS DB and UI