Skip to content

Commit

Permalink
Add undocumentated commands
Browse files Browse the repository at this point in the history
  • Loading branch information
ben221199 committed Nov 16, 2022
1 parent 34256d8 commit c5d7fb6
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"license": "GPL-3.0-or-later",
"require": {
"php": "^7||^8",
"ext-curl": "*",
"ext-simplexml": "*"
},
"require-dev": {
Expand Down
43 changes: 42 additions & 1 deletion src/OxxaAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,14 @@ public function DOMAIN_CHECK(array $arguments=[]){
return $this->fetchCommandWithCredentials('domain_check',$arguments);
}

/**
* @param array $arguments
* @return mixed
*/
public function DOMAIN_CHECKNEW(array $arguments=[]){
return $this->fetchCommandWithCredentials('domain_checknew',$arguments);
}

/**
* @param array $arguments
* @return mixed
Expand Down Expand Up @@ -452,6 +460,14 @@ public function DOMAIN_UPD(array $arguments=[]){
return $this->fetchCommandWithCredentials('domain_upd',$arguments);
}

/**
* @param array $arguments
* @return mixed
*/
public function EXTENSION_LIST(array $arguments=[]){
return $this->fetchCommandWithCredentials('extension_list',$arguments);
}

/**
* @param array $arguments
* @return mixed
Expand Down Expand Up @@ -1216,6 +1232,22 @@ public function OWNERCRESEND(array $arguments=[]){
return $this->fetchCommandWithCredentials('ownercresend',$arguments);
}

/**
* @param array $arguments
* @return mixed
*/
public function USERSETTINGS(array $arguments=[]){
return $this->fetchCommandWithCredentials('usersettings',$arguments);
}

/**
* @param array $arguments
* @return mixed
*/
public function USERSETTINGSGET(array $arguments=[]){
return $this->fetchCommandWithCredentials('usersettingsget',$arguments);
}

protected function fetchCommandWithCredentials(string $command,array $arguments){
$basicArguments = [
'apiuser' => $this->user,
Expand Down Expand Up @@ -1255,11 +1287,20 @@ protected function fetch(string $method,string $endpoint,array $headers,$body=nu

/**
* Converts boolean to 'Y' (Yes) or 'N' (No)
* @param $bool
* @param bool $bool
* @return string
*/
public static function convertBoolean($bool){
return $bool?'Y':'N';
}

/**
* Converts 'Y' (Yes) or 'N' (No) to boolean
* @param string $yesNo
* @return bool
*/
public static function convertYesNo($yesNo){
return $yesNo==='Y';
}

}

0 comments on commit c5d7fb6

Please sign in to comment.