public void AddStatusData(EntranceCode entranceCode, string transactionId) { var paymentXml = BuildXml(entranceCode, transactionId); var xmlDoc = new XDocument( new XDeclaration("1.0", "utf-8", "yes"), paymentXml); using (var mem = new MemoryStream()) using (var writer = new XmlTextWriter(mem, Encoding.UTF8)) { writer.Formatting = Formatting.Indented; xmlDoc.WriteTo(writer); writer.Flush(); mem.Flush(); mem.Seek(0, SeekOrigin.Begin); using (var reader = new StreamReader(mem)) { var xml = reader.ReadToEnd(); TtrsFile attachment = new TtrsFile { File = new StringContent(xml), Filename = Filename(), FileType = "xml", MimeType = "application/xml" }; AddFile(attachment); } } }
public void AddFile(TtrsFile file) { RequestType.File = file; }