Example #1
0
require_once $LIB_DIR . "response.class.php";
$DomOrder = new DomOrder($LIB_DIR . "wsdl/domain.wsdl");
// Creating an instance of DomOrder by passing wsdl url.
$Customer = new Customer($LIB_DIR . "wsdl/customer.wsdl");
// Creating an instance of DomOrder by passing wsdl url.
// create/get the accounts id:
$return = $Customer->getCustomerId($USERNAME, $PASSWORD, "reseller", "en", $PARENTID, $VAR['ACCT_USER']);
if (is_array($return)) {
    # add account
    $return = $Customer->addCustomer($USERNAME, $PASSWORD, "reseller", "en", $PARENTID, $VAR['ACCT_USER'], $VAR['ACCT_PASS'], $VAR['ACCT_NAME'], $VAR['ACCT_ADDR'], "", "", "", $VAR['ACCT_CITY'], $VAR['ACCT_STATE'], $VAR['ACCT_COUNTRY'], $VAR['ACCT_ZIP'], "01", "8885551212", "01", "8885551212", "01", "8885551212", "en");
}
// Register domain
if (!is_array($return)) {
    $account = $return;
    $return = $DomOrder->registerDomain($USERNAME, $PASSWORD, "reseller", "en", $PARENTID, $domainHash, $nsHash, $account, $account, $account, $account, $account, 'NoInvoice');
}
$response = new Response($return);
// Status
if (@$return['status'] == 'Success') {
    echo 'REGISTER SUCCESS!';
}
// Common Output for all above functions.
print "<BR><b>Output</b><br><br>";
if ($response->isError()) {
    $response->printError();
} else {
    $result = $response->getResult();
    $response->printData($result);
}
?>
 
 function addDomContact()
 {
     $this->error_str = "";
     $this->iserror = false;
     $DomContact = new DomContact(LIBRARIES . "directi" . PATH_SEP . "wsdl" . PATH_SEP . "domaincontact.wsdl");
     $return = $DomContact->addDefaultContact($this->USERNAME, $this->PASSWORD, $this->ROLE, $this->LANGPREF, $this->PARENTID, $this->account);
     $response = new Response($return);
     $response->errorAnalyse();
     if ($response->isError()) {
         $this->error_str = $response->errorMsg;
         $this->iserror = true;
         return;
     } else {
         $this->contact = $response->getResult();
     }
     if (empty($this->contact)) {
         $this->error_str = "An unknown error occurred while adding domain contact!";
         $this->iserror = true;
     }
     return;
 }