/// <summary> /// 企业用户注册 /// </summary> /// <param name="companyRegisterRequest"></param> /// <returns></returns> public CompanyRegisterResponse companyRegister(CompanyRegisterRequest companyRegisterRequest) { SignRequest signRequest = new SignRequest(companyRegisterRequest); signRequest.apiUrl = ApiUrlConstant.Company.Register; CompanyRegisterResponse response = base.Send <CompanyRegisterResponse>(signRequest); return(response); }
/// <summary> /// 企业用户注册并申请证书 /// </summary> /// <param name="request"></param> /// <returns></returns> public CompanyRegisterResponse companyCertRegister(CompanyRegisterRequest companyRegisterRequest) { //企业用户注册 SignRequest signRequest = new SignRequest(companyRegisterRequest); signRequest.apiUrl = ApiUrlConstant.Company.Register; CompanyRegisterResponse response = base.Send <CompanyRegisterResponse>(signRequest); //证书申请 signRequest = new SignRequest(new CertApplyRequest(response.user_id)); signRequest.apiUrl = ApiUrlConstant.Cert.Apply; CertApplyResponse certApplyResponse = base.Send <CertApplyResponse>(signRequest); return(response); }
/// <summary> /// 企业用户注册并申请证书 /// </summary> public void companyCertRegister() { CompanyRegisterRequest companyRegisterRequest = new CompanyRegisterRequest(); companyRegisterRequest.user_name = "测试某集团子公司用户"; companyRegisterRequest.area_code = "370000"; companyRegisterRequest.unit_type = CompanyType.Company; companyRegisterRequest.credi_code = "11320111MA3F1JM421"; companyRegisterRequest.legal_name = "李四"; companyRegisterRequest.legal_id_number = "370000111111111112"; companyRegisterRequest.legal_id_type = IdType.IDCARD; companyRegisterRequest.legal_phone = "13711111111"; companyRegisterRequest.legal_email = "*****@*****.**"; companyRegisterRequest.agent_name = "王五"; companyRegisterRequest.agent_id_number = "370000111111111122"; companyRegisterRequest.agent_id_type = IdType.IDCARD; companyRegisterRequest.agent_phone = "13711111111"; companyRegisterRequest.agent_email = "*****@*****.**"; companyRegisterRequest.description = "描述信息:demo code"; try { CompanyRegisterResponse companyRegisterResponse = client.Company.companyCertRegister(companyRegisterRequest); Console.WriteLine("企业客户以及证书注册-响应数据:" + JSONUtil.getJsonStringFromObject(companyRegisterResponse)); } catch (SignApplicationException sae) { // 捕获网关校验数据 Console.WriteLine("企业客户以及证书注册-网关异常状态码为:" + sae.return_code); Console.WriteLine("企业客户以及证书注册-网关异常信息为:" + sae.return_message); } catch (SignServerException sse) { // 捕获网关校验数据 Console.WriteLine("企业客户以及证书注册-业务异常状态码为:" + sse.result_code); Console.WriteLine("企业客户以及证书注册-业务异常信息为:" + sse.result_message); } catch (Exception e) { Console.WriteLine("企业客户以及证书注册-异常为:" + e.Message); } }