/// <summary> /// Get the Xml for the message /// </summary> /// <returns></returns> public override byte[] GetXml() { AutoGen.NotificationHistoryRequest retVal = new GCheckout.AutoGen.NotificationHistoryRequest(); if (!string.IsNullOrEmpty(_nextPageToken)) { retVal.nextpagetoken = _nextPageToken; } else { if (_startTime > DateTime.MinValue) { retVal.starttime = _startTime; retVal.starttimeSpecified = true; retVal.endtime = _endTime; retVal.endtimeSpecified = true; } if (_orderNumbers != null && _orderNumbers.Count > 0) { retVal.ordernumbers = _orderNumbers.ToArray(); } if (_notificationTypes != null && _notificationTypes.Count > 0) { //we need to convert the list List <string> nt = new List <string>(); Type t = typeof(NotificationTypes); foreach (NotificationTypes item in _notificationTypes) { FieldInfo fi = t.GetField(item.ToString()); nt.Add(EnumSerilizedNameAttribute.GetValue(fi)); } } if (_serialNumber != null && !string.IsNullOrEmpty(_serialNumber.SerialNumber)) { retVal.serialnumber = _serialNumber.SerialNumber; } } return(EncodeHelper.Serialize(retVal)); }
/// <summary> /// Get the Xml for the message /// </summary> /// <returns></returns> public override byte[] GetXml() { AutoGen.NotificationHistoryRequest retVal = new GCheckout.AutoGen.NotificationHistoryRequest(); if (!string.IsNullOrEmpty(_nextPageToken)) { retVal.nextpagetoken = _nextPageToken; } else { if (_startTime > DateTime.MinValue) { retVal.starttime = _startTime; retVal.starttimeSpecified = true; retVal.endtime = _endTime; retVal.endtimeSpecified = true; } if (_orderNumbers != null && _orderNumbers.Count > 0) { retVal.ordernumbers = _orderNumbers.ToArray(); } if (_notificationTypes != null && _notificationTypes.Count > 0) { //we need to convert the list List<string> nt = new List<string>(); Type t = typeof(NotificationTypes); foreach (NotificationTypes item in _notificationTypes) { FieldInfo fi = t.GetField(item.ToString()); nt.Add(EnumSerilizedNameAttribute.GetValue(fi)); } } if (_serialNumber != null && !string.IsNullOrEmpty(_serialNumber.SerialNumber)) { retVal.serialnumber = _serialNumber.SerialNumber; } } return EncodeHelper.Serialize(retVal); }