using System; using System.Collections.Generic; using System.Xml.Serialization; using BWP.ABCClient.Common; namespace BWP.ABCClient.B2C { [XmlRoot(ElementName = "MSG")] public class SettleResponse : MessageBase { public MessageContent Message { get; set; } public class MessageContent { public MerchantContent Merchant { get; set; } public TrxResponseContent TrxResponse { get; set; } } public class TrxResponseContent { public string ReturnCode { get; set; } public string ErrorMessage { get; set; } private string _zipDetailRecords; public string ZIPDetailRecords { get { return _zipDetailRecords; } set { _zipDetailRecords = value; SetDetailRecords(value); } } private void SetDetailRecords(string value) { if (string.IsNullOrEmpty(value)) { return; } string innerXml = MsgUtil.DeCompress(value); string xml = "" + innerXml + ""; var records = MsgUtil.GetMultiInnerXml(xml, "//Record"); var recordList = new List(records.Length); foreach (var record in records) { var recordCols = record.Split(new[] {','}, StringSplitOptions.None); recordList.Add(new Record { Sign = recordCols[0], OrderNumber = recordCols[1], Amount = recordCols[2], DaySeqNo = recordCols[3], Date = recordCols[4] }); } DetailRecords = recordList.ToArray(); } public Record[] DetailRecords { get; set; } } } public class Record { public string Sign { get; set; } public string OrderNumber { get; set; } public string Amount { get; set; } public string DaySeqNo { get; set; } public string Date { get; set; } } }