Skip to content

Commit

Permalink
Merge pull request #9 from xa81/main
Browse files Browse the repository at this point in the history
1.0.8
  • Loading branch information
xa81 authored Jan 2, 2025
2 parents dc9b82c + bb541a8 commit e60d79c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
32 changes: 21 additions & 11 deletions components/modules/domainnameapi/apis/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Class DomainNameAPI_PHPLibrary
* @package DomainNameApi
* @version 2.1.1
* @version 2.1.3
*/


Expand All @@ -26,7 +26,7 @@ class DomainNameAPI_PHPLibrary
/**
* Version of the library
*/
const VERSION = '2.1.1';
const VERSION = '2.1.3';

const DEFAULT_NAMESERVERS = [
'ns1.domainnameapi.com',
Expand All @@ -52,7 +52,7 @@ class DomainNameAPI_PHPLibrary
* This request does not include sensitive informations, sensitive informations are filtered.
* @var string $errorReportingDsn
*/
private string $errorReportingDsn = 'https://d4e2d61e4af2d4c68fb21ab93bf51ff2@o4507492369039360.ingest.de.sentry.io/4507492373954640';
private string $errorReportingDsn = 'https://0ea94fed70c09f95c17dfa211d43ac66@sentry.atakdomain.com/2';

/**
* Api Username
Expand Down Expand Up @@ -93,13 +93,23 @@ public function __construct($userName = "ownername", $password = "ownerpass", $t
self::setCredentials($userName, $password);
self::useTestMode($testMode);

$context = stream_context_create(
[
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false
]
]
);

try {
// Create unique connection
$this->service = new SoapClient($this->serviceUrl . "?singlewsdl", [
"encoding" => "UTF-8",
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
'exceptions' => true,
'connection_timeout' => 20,
'stream_context' => $context
]);
} catch (SoapFault $e) {
$this->sendErrorToSentryAsync($e);
Expand Down Expand Up @@ -2114,45 +2124,45 @@ private function parseCall($fn, $parameters, $_callback)
{
$result = [
'result' => 'ERROR',
'error' => 'Unknown Error Occured'
'error' => 'Unknown Error Occurred'
];

try {
$parameters["request"]["UserName"] = $this->serviceUsername;
$parameters["request"]["Password"] = $this->servicePassword;
// SOAP method which is same as current function name called
// Call the SOAP method with the same name as the current function
$_response = $this->service->__soapCall($fn, [$parameters]);

// Get the last response
$this->service->__getLastResponse();


// Serialize as array
// Convert response to array
$_response = $this->objectToArray($_response);

// Set function, request, and response data
$this->setLastFunction($fn);
$this->setRequestData($parameters);
$this->setResponseData($_response);


// Check is there any error?
// Check for errors in the response
if (!$this->hasError($_response)) {
$result = $_callback($_response);
} else {
// Hata mesajini dondura
$result["result"] = "ERROR";
$result["error"] = $this->parseError($_response);
}

} catch (SoapFault $ex) {
$result["result"] = "ERROR";
$result["error"] = $this->setError('INVALID_RESPONSE', 'Invalid Response occured', $ex->getMessage());
$result["error"] = $this->setError('INVALID_RESPONSE', 'Invalid response occurred', $ex->getMessage());
$this->sendErrorToSentryAsync($ex);
} catch (Exception $ex) {
$result["result"] = "ERROR";
$result["error"] = $this->parseError($this->objectToArray($ex));
$this->sendErrorToSentryAsync($ex);
}

// Set parsed response data
$this->setParsedResponseData($result);


Expand Down
2 changes: 1 addition & 1 deletion components/modules/domainnameapi/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.7",
"version": "1.0.8",
"type": "registrar",
"name": "Domainnameapi",
"description": "DomainNameApi is a domain registration module that allows you to register and manage domain names. More Than 800 extension!",
Expand Down

0 comments on commit e60d79c

Please sign in to comment.