Skip to content

Commit 3bcdf05

Browse files
committed
Update to v3.10.0
Updated files
1 parent 0f076f7 commit 3bcdf05

File tree

5 files changed

+60
-9
lines changed

5 files changed

+60
-9
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
RadWebHosting/whmcs.json.bak
3+
RadWebHosting/RadWebHosting.php.bak

RadWebHosting/Core/Configuration.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,15 @@ public function __get($name)
6969
*/
7070
public function getAuthHeaders()
7171
{
72-
$time = gmdate("y-m-d H");
72+
$timestamp = time();
73+
$time = gmdate("y-m-d H", $timestamp);
7374
$token = base64_encode(hash_hmac("sha256", $this->ApiKey, "{$this->Username}:$time"));
7475

7576
return
7677
[
7778
"username" => $this->Username,
78-
"token" => $token
79+
"token" => $token,
80+
"timestamp" => $timestamp,
7981
];
8082
}
8183
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
namespace ModulesGarden\DomainsReseller\Registrar\RadWebHosting\Helpers;
3+
use \WHMCS\Domains\DomainLookup\SearchResult;
4+
use \WHMCS\Domains\DomainLookup\ResultsList;
5+
/**
6+
* Description of ResultsListFactory
7+
*
8+
*/
9+
class ResultsListFactory
10+
{
11+
public static function createResultsList(array $domainResults = []): ResultsList
12+
{
13+
$resultList = new ResultsList();
14+
foreach ($domainResults as $domainResult) {
15+
if(!is_array($domainResult)) {
16+
\logModuleCall(
17+
'RadWebHosting',
18+
'DomainLookup',
19+
[],
20+
$domainResults
21+
);
22+
continue;
23+
}
24+
$searchResult = new SearchResult($domainResult["sld"], $domainResult["tld"]);
25+
$searchResult->setStatus($domainResult["status"]);
26+
if(!empty($domainResult["premiumCostPricing"]))
27+
{
28+
$searchResult->setPremiumCostPricing($domainResult["premiumCostPricing"]);
29+
}
30+
$resultList->append($searchResult);
31+
}
32+
return $resultList;
33+
}
34+
35+
}

RadWebHosting/RadWebHosting.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use ModulesGarden\DomainsReseller\Registrar\RadWebHosting\Calls;
44
use ModulesGarden\DomainsReseller\Registrar\RadWebHosting\Core\Configuration;
5+
use ModulesGarden\DomainsReseller\Registrar\RadWebHosting\Helpers\ResultsListFactory;
56

67
//Loader
78
include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Core' . DIRECTORY_SEPARATOR . "Loader.php";
@@ -210,7 +211,12 @@ function RadWebHosting_GetNameservers($params)
210211
try
211212
{
212213
$call = new Calls\GetNameServers(Configuration::create($params), $postfields);
213-
return $call->process();
214+
215+
$result = $call->process();
216+
unset($result['success']);
217+
unset($result['message']);
218+
219+
return $result;
214220
}
215221
catch (\Exception $e)
216222
{
@@ -714,11 +720,15 @@ function RadWebHosting_CheckAvailability($params)
714720
{
715721
$call = new Calls\CheckAvailability(Configuration::create($params), $postfields);
716722
$result = $call->process();
717-
718-
return unserialize($result);
723+
return ResultsListFactory::createResultsList($result);
719724
}
720725
catch (\Exception $e)
721726
{
722-
return ['error' => $e->getMessage()];
723-
}
727+
\logModuleCall(
728+
'RadWebHosting',
729+
'DomainLookup',
730+
$postfields,
731+
['error' => $e->getMessage()]
732+
);
733+
return ResultsListFactory::createResultsList([]); }
724734
}

RadWebHosting/whmcs.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"schema": "1.0",
3-
"type": "whmcs-registrars",
3+
"type": "whmcs-addons",
44
"name": "RadWebHosting",
5+
"license": "proprietary",
56
"category": "domains",
67
"description": {
7-
"name": "Rad Web Hosting",
8+
"name": "RadWebHosting",
89
"tagline": "Industry-leading domain registrar with over 500+ TLDs available.",
910
"long": "Rad Web Hosting powers the world\u2019s largest cloud platform. With thousands of websites hosted and thousands of domain names under management, Rad Web Hosting is the registrar of choice for more WHMCS resellers.\n\nNow with the Rad Web Hosting module for WHMCS, you can resell domains using the Rad Web Hosting domain reseller platform. To get started, download the module from the WHMCS Marketplace using the link to the right.\n\nSignup for a Rad Web Hosting account @ [https:\/\/radwebhosting.com\/domain-reseller](https:\/\/radwebhosting.com\/domain-reseller)\n\n## Reasons to Choose Rad Web Hosting\n* Trusted partner and champion of our customers.\n* Large, high growth business with attractive unit economics.\n* Industry-leading products built on a single cloud platform & distinctive customer care.\n* Proven growth strategy with team purpose built to execute.\n* Market Leading Wholesale Domain Pricing."
1011
},

0 commit comments

Comments
 (0)