Skip to content

Commit c1feea4

Browse files
Merge pull request #20 from xa81/main
Bump version to 2.1.13 and add support for .tr domain attributes
2 parents 4f9038d + ee123f0 commit c1feea4

File tree

1 file changed

+44
-8
lines changed

1 file changed

+44
-8
lines changed

DomainNameApi/DomainNameAPI_PHPLibrary.php

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* Class DomainNameAPI_PHPLibrary
1212
* @package DomainNameApi
13-
* @version 2.1.12
13+
* @version 2.1.13
1414
*/
1515

1616

@@ -25,20 +25,21 @@ class DomainNameAPI_PHPLibrary
2525
/**
2626
* Version of the library
2727
*/
28-
const VERSION = '2.1.12';
28+
const VERSION = '2.1.13';
2929

3030
const DEFAULT_NAMESERVERS = [
3131
'ns1.domainnameapi.com',
3232
'ns2.domainnameapi.com',
3333
];
3434

3535
const DEFAULT_IGNORED_ERRORS = [
36-
'*Domain not found*',
37-
'*ERR_DOMAIN_NOT_FOUND*',
38-
'*Reseller not found*',
39-
'*Domain is not in updateable status. It must be active*',
40-
'*balance is not sufficient*',
41-
'*Price definition not found*',
36+
'Domain not found',
37+
'ERR_DOMAIN_NOT_FOUND',
38+
'Reseller not found',
39+
'Domain is not in updateable status',
40+
'balance is not sufficient',
41+
'Price definition not found',
42+
'TLD is not supported',
4243
];
4344

4445
const DEFAULT_ERRORS = [
@@ -1263,6 +1264,41 @@ public function RegisterWithContactInfo(
12631264
]
12641265
];
12651266

1267+
if(substr($domainName, -3) == ".tr") {
1268+
1269+
if(!isset($addionalAttributes['TRABISDOMAINCATEGORY'])) {
1270+
$addionalAttributes['TRABISDOMAINCATEGORY'] = '1';
1271+
}
1272+
1273+
if(!isset($addionalAttributes['TRABISCOUNTRYID'])) {
1274+
$addionalAttributes['TRABISCOUNTRYID'] = 215;
1275+
$addionalAttributes['TRABISCOUNTRYNAME'] = 'TR';
1276+
$addionalAttributes['TRABISCITYNAME'] = 'Istanbul';
1277+
$addionalAttributes['TRABISCITIYID'] = 34;
1278+
}
1279+
1280+
if ($addionalAttributes['TRABISDOMAINCATEGORY'] == '1') {
1281+
if (!isset($addionalAttributes['TRABISNAMESURNAME'])) {
1282+
$addionalAttributes['TRABISNAMESURNAME'] = $parameters["request"]["RegistrantContact"]['FirstName'] . ' ' . $parameters["request"]["RegistrantContact"]['LastName'];
1283+
}
1284+
if (!isset($addionalAttributes['TRABISCITIZIENID'])) {
1285+
$addionalAttributes['TRABISCITIZIENID'] = '11111111111';
1286+
}
1287+
unset($addionalAttributes['TRABISORGANIZATION'],$addionalAttributes['TRABISTAXOFFICE'],$addionalAttributes['TRABISTAXNUMBER']);
1288+
}else{
1289+
if (!isset($addionalAttributes['TRABISORGANIZATION'])) {
1290+
$addionalAttributes['TRABISORGANIZATION'] = $parameters["request"]["RegistrantContact"]['Company'];
1291+
}
1292+
if (!isset($addionalAttributes['TRABISTAXOFFICE'])) {
1293+
$addionalAttributes['TRABISTAXOFFICE'] = 'Istanbul';
1294+
}
1295+
if (!isset($addionalAttributes['TRABISTAXNUMBER'])) {
1296+
$addionalAttributes['TRABISTAXNUMBER'] = '1111111111';
1297+
}
1298+
unset($addionalAttributes['TRABISNAMESURNAME'],$addionalAttributes['TRABISCITIZIENID']);
1299+
}
1300+
}
1301+
12661302
if (count($addionalAttributes) > 0) {
12671303
foreach ($addionalAttributes as $k => $v) {
12681304
$parameters['request']['AdditionalAttributes']['KeyValueOfstringstring'][] = [

0 commit comments

Comments
 (0)