Ejemplo n.º 1
0
 public function test__set_domainadditionalfield__returnSuccess()
 {
     $order_id = 123;
     $params['domainid'] = 15142;
     $result = Domenus::set_domainadditionalfield($params['domainid'], 'orderId', $order_id);
     print_r(var_dump($result));
 }
Ejemplo n.º 2
0
 public static function account_Balance($data = [])
 {
     $result = ['content' => '', 'errors' => [], 'status' => false];
     //nothing to validate
     $response = parent::send_request('account/balance', $data);
     $result['content'] = parent::parse_response($response);
     if ($result['content']['success'] == true) {
         $result['status'] = true;
     } else {
         $result['errors'][] = parent::get_status_code($result['content']['status']);
         $result['status'] = false;
     }
     return $result;
 }
Ejemplo n.º 3
0
 public static function order_Discloseinfo($data = [])
 {
     $result = ['content' => '', 'errors' => [], 'status' => false];
     $fields = ['registrant', 'hide_person', 'hide_email', 'hide_phone'];
     $validated = parent::validate($fields, $data);
     if (!empty($validated)) {
         $result['errors'] = $validated;
         return $result;
     }
     $response = parent::send_request('order/discloseinfo', $data);
     $result['content'] = parent::parse_response($response);
     if ($result['content']['success'] == true) {
         $result['status'] = true;
     }
     return $result;
 }
Ejemplo n.º 4
0
 public static function contact_Register($data = [])
 {
     $result = ['content' => '', 'errors' => [], 'status' => false];
     $fields = ['contact_type', 'name', 'name_ru', 'passport', 'birth_date', 'address_ru', 'paddr', 'phone', 'email', 'fax', 'firstname', 'lastname', 'address1', 'city', 'postalcode', 'country', 'state_province'];
     //by default we register domains for private users, not organizations or others
     if (!isset($data['contact_type']) || empty($data['contact_type'])) {
         $data['contact_type'] = 'person';
     }
     $validates = parent::validate($fields, $data);
     if (!empty($validated)) {
         $result['errors'] = $validated;
         return $result;
     }
     $response = parent::send_request('contact/register', $data);
     $result['content'] = parent::parse_response($response);
     if ($result['content']['success'] == true) {
         $result['status'] = true;
     } else {
         $result['status'] = false;
         $result['errors'][] = $result['content']['message'];
     }
     return $result;
 }
Ejemplo n.º 5
0
 public static function close_db_connection()
 {
     self::$dbh = null;
 }
Ejemplo n.º 6
0
 /**
  *   Register domain
  *   @param Array $data for registering domain
  *   @return Mixed orderId 
  */
 public static function domain_Register($data = [])
 {
     $result = ['content' => '', 'errors' => [], 'status' => false];
     $fields = ['domain', 'nserver', 'someextattrib'];
     if (isset($data['domain'])) {
         $data['domain'] = idn_to_ascii($data['domain']);
     }
     $ns_servers = Domenus::get_ns_servers();
     // substituting default NS servers from configs
     if (empty($data['nserver'])) {
         $data['nserver'] = $ns_servers;
     }
     $validated = parent::validate($fields, $data);
     if (!empty($validated)) {
         $result['errors'] = $validated;
         return $result;
     }
     $response = parent::send_request('domain/register', $data);
     $result['content'] = parent::parse_response($response);
     if ($result['content']['success'] == true) {
         $result['status'] = true;
     } else {
         $result['errors'][] = self::get_status_code($result['content']['status']);
         $result['status'] = false;
     }
     return $result;
 }
Ejemplo n.º 7
0
/**
 *  Syncing the domains
 *  @param Array $params containing domain arguments
 * */
function domenus_Sync($params)
{
    $return_data = [];
    $domain = "{$params['sld']}.{$params['tld']}";
    if (empty($domain)) {
        $return_data['error'] = "There's no domain passed in sync function";
        return $return_data;
    }
    $checked = Domenus::call('domain/info', ['domain' => $domain]);
    if ($checked['status'] == true) {
        if ($checked['content']['data']['reg_till']) {
            $reg_till = $checked['content']['data']['reg_till'];
            $reg_till = date('Y-m-d', strtotime($reg_till));
            $return_data['expirydate'] = $reg_till;
            if (date('Ymd') <= str_replace('-', '', $return_data['expirydate'])) {
                $return_data['active'] = true;
            } else {
                $return_data['expired'] = true;
            }
        } else {
            $return_data['expired'] = true;
        }
    } else {
        $return_data['error'] = join('. ', $checked['errors']);
    }
    logModuleCall('domenus_registrar', __FUNCTION__, print_r(['domain' => $domain], 1), null, print_r($checked, 1));
    return $return_data;
}