示例#1
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;
 }
示例#2
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;
 }
示例#3
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;
 }
示例#4
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;
 }