/// <summary> /// 签约华夏银行 他行开户 /// </summary> /// <param name="TdUser">用户信息</param> /// <param name="openbank">开户行信息</param> /// <param name="codeDesc">签约结果代码描述</param> /// <param name="subUser">子账号</param> /// <returns>成功返回true 失败返回fasle</returns> public static bool ContactToHuaxiaOhterBank(TradeUser TdUser, OpenBankInfo openbank, ref string codeDesc, ref string subUser) { bool IsSuc = false; IntersServerImplClient ic = new IntersServerImplClient(); try { StringBuilder inXml = new StringBuilder(); inXml.Append("<HXBB2B>"); inXml.Append("<MessageData>"); inXml.Append("<Base>"); inXml.Append("<Version>1.0</Version>"); inXml.Append("<SignFlag>0</SignFlag>"); inXml.Append("<Language>GB2312</Language>"); inXml.Append("</Base>"); inXml.Append("<ReqHeader>"); inXml.AppendFormat("<ClientTime>{0}</ClientTime>", DateTime.Now.ToString("yyyyMMddHHmmss")); inXml.Append("<MerchantNo>600014</MerchantNo>"); inXml.Append("</ReqHeader>"); inXml.Append("<DataBody>"); inXml.AppendFormat("<MerTxSerNo>{0}</MerTxSerNo>", TdUser.CashUser); inXml.Append("<TrnxCode>DZ020</TrnxCode>"); inXml.Append("<AccountInfos>"); inXml.Append("<AccountInfo>"); inXml.AppendFormat("<MerAccountNo>{0}</MerAccountNo>", GetTanUser(TdUser.TanUser)); inXml.AppendFormat("<AccountName>{0}</AccountName>", TdUser.UserName); inXml.AppendFormat("<AccountProp>{0}</AccountProp>", "0" == TdUser.AccountType ? 1 : 0);//华夏银行接口中,0表示企业1表示个人 inXml.AppendFormat("<RelatingAcct>{0}</RelatingAcct>", openbank.BankCard); inXml.AppendFormat("<RelatingAcctName>{0}</RelatingAcctName>", openbank.AccountName); inXml.Append("<InterBankFlag>1</InterBankFlag>"); inXml.AppendFormat("<RelatingAcctBank>{0}</RelatingAcctBank>", openbank.OpenBank); inXml.AppendFormat("<RelatingAcctBankAddr>{0}</RelatingAcctBankAddr>", openbank.OpenBankAddress); inXml.AppendFormat("<RelatingAcctBankCode>{0}</RelatingAcctBankCode>", openbank.BankAccount); inXml.Append("<Amt></Amt>"); inXml.Append("<AmtUse></AmtUse>"); inXml.AppendFormat("<PersonName>{0}</PersonName>", string.IsNullOrEmpty(TdUser.LinkMan) ? string.Empty : TdUser.LinkMan); inXml.AppendFormat("<OfficeTel>{0}</OfficeTel>", string.IsNullOrEmpty(TdUser.TelNum) ? string.Empty : TdUser.TelNum); inXml.AppendFormat("<MobileTel>{0}</MobileTel>", string.IsNullOrEmpty(TdUser.PhoneNum) ? string.Empty : TdUser.PhoneNum); inXml.AppendFormat("<Addr>{0}</Addr>", string.IsNullOrEmpty(TdUser.LinkAdress) ? string.Empty : TdUser.LinkAdress); inXml.Append("<ZipCode></ZipCode>"); inXml.AppendFormat("<LawName>{0}</LawName>", string.IsNullOrEmpty(TdUser.CorporationName) ? string.Empty : TdUser.CorporationName); inXml.AppendFormat("<LawType>{0}</LawType>", "1" == TdUser.CardType ? 1 : 6); //华夏证件类型: //1 – 个人身份证 //2 – 军人证、警官证 //3 – 临时证件 //4 – 户口本 //5 – 护照 //6 – 其他 inXml.AppendFormat("<LawNo>{0}</LawNo>", string.IsNullOrEmpty(TdUser.CardNum) ? string.Empty : TdUser.CardNum); inXml.Append("<NoteFlag>1</NoteFlag>"); inXml.AppendFormat("<NotePhone>{0}</NotePhone>", string.IsNullOrEmpty(TdUser.PhoneNum) ? string.Empty : TdUser.PhoneNum); inXml.AppendFormat("<EMail>{0}</EMail>", string.IsNullOrEmpty(TdUser.Email) ? string.Empty : TdUser.Email); inXml.AppendFormat("<CheckFlag>{0}</CheckFlag>", "1" == TdUser.AccountType ? 1 : 0); inXml.Append("</AccountInfo>"); inXml.Append("</AccountInfos>"); inXml.Append("</DataBody>"); inXml.Append("</MessageData>"); inXml.Append("</HXBB2B>"); com.individual.helper.LogNet4.WriteMsg("华夏银行他行签约,请求的Xml报文:" + inXml.ToString()); string outXml = ic.Process(inXml.ToString()); com.individual.helper.LogNet4.WriteMsg("华夏银行他行签约,响应的Xml报文:" + outXml); XmlDocument xmldoc = new XmlDocument(); xmldoc.LoadXml(outXml); if (HuaxiaSuc == xmldoc.SelectSingleNode("HXBB2B/MessageData/ResHeader/Status/Code").InnerText) { subUser = xmldoc.SelectSingleNode("HXBB2B/MessageData/DataBody/AccountInfos/AccountInfo/AccountNo").InnerText; IsSuc = true; } codeDesc = xmldoc.SelectSingleNode("HXBB2B/MessageData/ResHeader/Status/Message").InnerText; ic.Close(); } catch (Exception ex) { ic.Abort(); throw new Exception(ex.Message, ex); } return IsSuc; }
/// <summary> /// 签约华夏银行 本行开户 /// </summary> /// <param name="TdUser">用户信息</param> /// <param name="codeDesc">签约结果代码描述</param> /// <returns>成功返回true 失败返回fasle</returns> public static bool ContactToHuaxiaSelfBank(TradeUser TdUser, ref string codeDesc) { bool IsSuc = false; IntersServerImplClient ic = new IntersServerImplClient(); try { StringBuilder inXml = new StringBuilder(); inXml.Append("<HXBB2B>"); inXml.Append("<MessageData>"); inXml.Append("<Base>"); inXml.Append("<Version>1.0</Version>"); inXml.Append("<SignFlag>0</SignFlag>"); inXml.Append("<Language>GB2312</Language>"); inXml.Append("</Base>"); inXml.Append("<ReqHeader>"); inXml.AppendFormat("<ClientTime>{0}</ClientTime>", DateTime.Now.ToString("yyyyMMddHHmmss")); inXml.Append("<MerchantNo>600014</MerchantNo>"); inXml.Append("</ReqHeader>"); inXml.Append("<DataBody>"); inXml.AppendFormat("<MerTxSerNo>{0}</MerTxSerNo>", TdUser.CashUser); inXml.Append("<TrnxCode>DZ010</TrnxCode>"); inXml.Append("<AccountInfos>"); inXml.Append("<AccountInfo>"); inXml.Append("<AccountNo></AccountNo>"); inXml.AppendFormat("<MerAccountNo>{0}</MerAccountNo>", GetTanUser(TdUser.TanUser)); inXml.AppendFormat("<AccountName>{0}</AccountName>", TdUser.UserName); inXml.AppendFormat("<AccountProp>{0}</AccountProp>", "0" == TdUser.AccountType ? 1 : 0);//华夏银行接口中,0表示企业1表示个人 inXml.Append("<Amt></Amt>");//总余额 inXml.Append("<AmtUse></AmtUse>");//可用余额 inXml.AppendFormat("<PersonName>{0}</PersonName>", string.IsNullOrEmpty(TdUser.LinkMan) ? string.Empty : TdUser.LinkMan); inXml.AppendFormat("<OfficeTel>{0}</OfficeTel>", string.IsNullOrEmpty(TdUser.TelNum) ? string.Empty : TdUser.TelNum); inXml.AppendFormat("<MobileTel>{0}</MobileTel>", string.IsNullOrEmpty(TdUser.PhoneNum) ? string.Empty : TdUser.PhoneNum); inXml.AppendFormat("<Addr>{0}</Addr>", string.IsNullOrEmpty(TdUser.LinkAdress) ? string.Empty : TdUser.LinkAdress); inXml.Append("</AccountInfo>"); inXml.Append("</AccountInfos>"); inXml.Append("</DataBody>"); inXml.Append("</MessageData>"); inXml.Append("</HXBB2B>"); com.individual.helper.LogNet4.WriteMsg("华夏银行本行签约,请求的Xml报文:" + inXml.ToString()); string outXml = ic.Process(inXml.ToString()); com.individual.helper.LogNet4.WriteMsg("华夏银行本行签约,响应的Xml报文:" + outXml); XmlDocument xmldoc = new XmlDocument(); xmldoc.LoadXml(outXml); if (HuaxiaSuc == xmldoc.SelectSingleNode("HXBB2B/MessageData/ResHeader/Status/Code").InnerText) { IsSuc = true; } codeDesc = xmldoc.SelectSingleNode("HXBB2B/MessageData/ResHeader/Status/Message").InnerText; ic.Close(); } catch (Exception ex) { ic.Abort(); throw new Exception(ex.Message, ex); } return IsSuc; }
/// <summary> /// 华夏银行出金 /// </summary> /// <param name="FdInfo">资金信息</param> /// <param name="money">出金金额</param> /// <param name="codeDesc">出金结果代码描述</param> /// <returns>成功返回true 失败返回fasle</returns> public static bool ChuJinHuaxiaBank(Fundinfo FdInfo, double money, ref string codeDesc) { bool IsSuc = false; IntersServerImplClient ic = new IntersServerImplClient(); try { StringBuilder inXml = new StringBuilder(); inXml.Append("<HXBB2B>"); inXml.Append("<MessageData>"); inXml.Append("<Base>"); inXml.Append("<Version>1.0</Version>"); inXml.Append("<SignFlag>0</SignFlag>"); inXml.Append("<Language>GB2312</Language>"); inXml.Append("</Base>"); inXml.Append("<ReqHeader>"); inXml.AppendFormat("<ClientTime>{0}</ClientTime>", DateTime.Now.ToString("yyyyMMddHHmmss")); inXml.Append("<MerchantNo>600014</MerchantNo>"); inXml.Append("</ReqHeader>"); inXml.Append("<DataBody>"); inXml.AppendFormat("<MerTxSerNo>{0}</MerTxSerNo>", FdInfo.CashUser); inXml.Append("<TrnxCode>DZ017</TrnxCode>"); inXml.AppendFormat("<AccountNo>{0}</AccountNo>", FdInfo.SubUser); inXml.AppendFormat("<MerAccountNo>{0}</MerAccountNo>", GetTanUser(FdInfo.TanUser)); inXml.AppendFormat("<Amt>{0}</Amt>", money); inXml.Append("</DataBody>"); inXml.Append("</MessageData>"); inXml.Append("</HXBB2B>"); com.individual.helper.LogNet4.WriteMsg("华夏银行出金,请求的Xml报文:" + inXml.ToString()); string outXml = ic.Process(inXml.ToString()); com.individual.helper.LogNet4.WriteMsg("华夏银行出金,响应的Xml报文:" + outXml); XmlDocument xmldoc = new XmlDocument(); xmldoc.LoadXml(outXml); if (HuaxiaSuc == xmldoc.SelectSingleNode("HXBB2B/MessageData/ResHeader/Status/Code").InnerText) { IsSuc = true; } codeDesc = xmldoc.SelectSingleNode("HXBB2B/MessageData/ResHeader/Status/Message").InnerText; ic.Close(); } catch (Exception ex) { ic.Abort(); throw new Exception(ex.Message, ex); } return IsSuc; }