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)); }
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; }
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; }
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; }
public static function close_db_connection() { self::$dbh = null; }
/** * 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; }
/** * 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; }