Skip to content

Commit 6978421

Browse files
committed
Add Name.com domain registrar adapter
- Implement NameCom adapter with full API v4 REST support - Add comprehensive test suite for NameCom adapter - Update GitHub Actions workflow to include NameCom credentials - Update README with documentation for both OpenSRS and NameCom adapters Features: - Domain availability checking - Domain registration and purchase - Domain transfers with auth codes - Domain renewal and management - Nameserver updates - Domain suggestions and search - Price lookups with caching support - Transfer status checking - Full exception handling The adapter supports both production (api.name.com) and sandbox (api.dev.name.com) endpoints.
1 parent 52b654f commit 6978421

File tree

4 files changed

+1180
-6
lines changed

4 files changed

+1180
-6
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ jobs:
2828
run: |
2929
export OPENSRS_KEY=${{ secrets.OPENSRS_KEY }}
3030
export OPENSRS_USERNAME=${{ secrets.OPENSRS_USERNAME }}
31+
export NAMECOM_USERNAME=${{ secrets.NAMECOM_USERNAME }}
32+
export NAMECOM_TOKEN=${{ secrets.NAMECOM_TOKEN }}
3133
composer test

README.md

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ php ./data/import.php
7777
7878

7979
## Using the Registrar API
80+
81+
The library supports multiple domain registrar adapters:
82+
- **OpenSRS** - OpenSRS domain registrar
83+
- **NameCom** - Name.com domain registrar
84+
85+
### Using OpenSRS Adapter
8086
```php
8187
<?php
8288

@@ -85,18 +91,45 @@ use Utopia\Domains\Registrar\Contact;
8591
use Utopia\Domains\Registrar\Adapter\OpenSRS;
8692

8793
$opensrs = new OpenSRS(
88-
'apikey',
89-
'apisecret',
90-
'username',
91-
'password',
94+
'apikey',
95+
'username',
96+
'password',
9297
[
9398
'ns1.nameserver.com',
9499
'ns2.nameserver.com',
95-
]
100+
],
101+
'https://horizon.opensrs.net:55443' // or 'https://rr-n1-tor.opensrs.net:55443' for production
96102
);
97103

98-
99104
$reg = new Registrar($opensrs);
105+
```
106+
107+
### Using NameCom Adapter
108+
```php
109+
<?php
110+
111+
use Utopia\Domains\Registrar;
112+
use Utopia\Domains\Registrar\Contact;
113+
use Utopia\Domains\Registrar\Adapter\NameCom;
114+
115+
$namecom = new NameCom(
116+
'username',
117+
'api-token',
118+
[
119+
'ns1.name.com',
120+
'ns2.name.com',
121+
],
122+
'https://api.name.com' // or 'https://api.dev.name.com' for testing
123+
);
124+
125+
$reg = new Registrar($namecom);
126+
```
127+
128+
### Using the Registrar
129+
Once you have initialized an adapter, you can use the Registrar API:
130+
131+
```php
132+
$reg = new Registrar($adapter); // $adapter can be OpenSRS or NameCom
100133

101134
$contact = new Contact(
102135
'firstname',

0 commit comments

Comments
 (0)