/// <summary> /// 企业用户重新认证企业 /// </summary> /// <param name="client"></param> /// <param name="realNameAuth">认证对象</param> /// <returns></returns> public string EnterpriseReCertification(SDKClient client, RealNameAuth realNameAuth) { if (!RealNameAuth.AUTH_TYPE_ENTERPRISE.Equals(realNameAuth.type)) { throw new Exception("EnterpriseReCertification失败, 失败原因: 用户类型必须为 RealNameAuth.AUTH_TYPE_ENTERPRISE"); } string response = null; try { RecertificationRequest request = new RecertificationRequest(realNameAuth); response = client.Service(request); } catch (Exception e) { throw new Exception("EnterpriseReCertification失败,失败原因: " + e.Message); } SdkResponse <NoCustomResult> sdkResponse = HttpJsonConvert.DeserializeResponse <NoCustomResult>(response); if (!sdkResponse.Success) { throw new Exception("EnterpriseReCertification失败,失败原因: " + sdkResponse.Message); } return(sdkResponse.Success.ToString()); }
public static HttpParamers WrapRealNameAuth(RealNameAuth realNameAuth) { realNameAuth.Check(); HttpParamers parameters = HttpParamers.PostParamers(); parameters.AddParamer("certNo", realNameAuth.CertNo); parameters.AddParamer("realName", realNameAuth.RealName); if (!string.IsNullOrEmpty(realNameAuth.EnterpriseRealName)) { parameters.AddParamer("enterpriseRealName", realNameAuth.EnterpriseRealName); } if (!string.IsNullOrEmpty(realNameAuth.EnterpriseCertType)) { parameters.AddParamer("enterpriseCertType", realNameAuth.EnterpriseCertType); } if (!string.IsNullOrEmpty(realNameAuth.EnterpriseCertNo)) { parameters.AddParamer("enterpriseCertNo", realNameAuth.EnterpriseCertNo); } if (!string.IsNullOrEmpty(realNameAuth.Mobile)) { parameters.AddParamer("mobile", realNameAuth.Mobile); } if (!string.IsNullOrEmpty(realNameAuth.Mail)) { parameters.AddParamer("mail", realNameAuth.Mail); } parameters.AddParamer("type", realNameAuth.Type); return(parameters); }
/// <summary> /// 企业实名认证修改 /// </summary> /// <param name="authCaseType"> /// see above CASE definition /// </param> static private void EnterpriseReAuth() { RealNameAuth realNameAuth = realNameAuth = RealNameAuth.EnterpriseRealNameAuth("慢慢", "500235199412169110", "18711112222", "91500000MA5UCYU7ZY", "慢慢科技", SxqConst.ID_BUSINESS_LICENCE); BaseSample baseSample = new BaseSample(); String result = baseSample.EnterpriseReCertification(GetOrCreateClient(), realNameAuth); Console.WriteLine("Call enterpriseReCertification api finished: " + result.ToString()); }
/// <summary> /// 个人|企业 实名认证 /// </summary> /// <param name="authCaseType"> /// see above CASE definition /// </param> static private void RealName(int authCaseType) { RealNameAuth realNameAuth = null; switch (authCaseType) { case CASE_AUTH_PERSON: realNameAuth = RealNameAuth.PersonRealNameAuth("试试", "500235199412169110", "18700001111"); break; case CASE_AUTH_ENTERPRISE: realNameAuth = RealNameAuth.EnterpriseRealNameAuth("慢慢", "500235199412169110", "18711112222", "91500000MA5UCYU7ZY", "慢慢科技", SxqConst.ID_BUSINESS_LICENCE); break; default: break; } BaseSample baseSample = new BaseSample(); String result = baseSample.RealName(GetOrCreateClient(), realNameAuth); Console.WriteLine("Call RealNameAuth api finished: " + result.ToString()); }
/// <summary> /// 用户实名认证 /// </summary> /// <param name="client"></param> /// <param name="realNameAuth">实名对象</param> /// <returns></returns> public string RealName(SDKClient client, RealNameAuth realNameAuth) { string response = null; try { RealNameRequest request = new RealNameRequest(realNameAuth); response = client.Service(request); } catch (Exception e) { throw new Exception("RealNameAuth失败,失败原因: " + e.Message); } SdkResponse <NoCustomResult> sdkResponse = HttpJsonConvert.DeserializeResponse <NoCustomResult>(response); if (!sdkResponse.Success) { throw new Exception("RealNameAuth失败,失败原因: " + sdkResponse.Message); } return(sdkResponse.Success.ToString()); }
public RealNameRequest(RealNameAuth realNameAuth) { this.realNameAuth = realNameAuth; }
public RecertificationRequest(RealNameAuth realNameAuth) { this.realNameAuth = realNameAuth; }