Registrar adapters let FOSSBilling communicate with domain registrars to register, transfer, and manage domains on behalf of your customers.
File Structure
Section titled “File Structure”Place your adapter in:
Directorylibrary/Registrar/Adapter/
- YourRegistrar.php
Your class must extend Registrar_AdapterAbstract and implement its required methods.
Common Methods
Section titled “Common Methods”FOSSBilling passes a Registrar_Domain to domain operations. See Registrar_AdapterAbstract for every required method and its signature.
| Method | Purpose |
|---|---|
isDomainAvailable() | Check domain availability |
registerDomain() | Register a new domain |
transferDomain() | Request a domain transfer |
renewDomain() | Renew a domain |
getDomainDetails() | Read domain details from the registrar |
modifyNs() | Update nameservers |
modifyContact() | Update contact information |
Namecheap Walkthrough
Section titled “Namecheap Walkthrough”The bundled Namecheap adapter illustrates availability checks and registration. Namecheap adapter source
- Configure the registrar.
getConfig()defines the admin form and marks the API key as secret. The constructor requires an API key, a username, and the server’s public IP address. Configuration code - Check availability.
isDomainAvailable()builds the name from the domain object and sendsnamecheap.domains.check. It reads the availability flag and rejects premium domains. Availability check - Register the domain.
registerDomain()sends the name, registration period, contacts, and any configured nameservers. It returnstruewhen Namecheap confirms the registration. Registration code - Handle provider errors. Both operations use
_makeRequest()to add authentication and parse the XML response. The helper raisesRegistrar_Exceptionfor provider-reported error statuses. Request handling
Testing Your Adapter
Section titled “Testing Your Adapter”- Create a test domain product in FOSSBilling
- Configure your registrar adapter in System → Domain Registration
- Test domain availability checks
- Test registration (if possible with registrar's test environment)
- Verify contact information syncing
Resources
Section titled “Resources”Getting Help
Section titled “Getting Help”Join our Discord if you need assistance with your registrar integration.