/// <summary> /// Process the file /// </summary> /// <param name="file"></param> /// <returns></returns> private async Task <NachaFile> ProcessFile(byte[] file) { var retVal = new NachaFile(); try { var content = Encoding.UTF8.GetString(file, 0, file.Length); var lines = GetLines(content); foreach (var line in lines) { switch (line[0]) { case '1': // File Header Record retVal.FileHeader = await ProcessFileHeaderRecord(line); break; case '5': // Batch Header Record break; case '6': // Entry Detail Record break; case '7': // Entry Detail Addenda Record break; case '8': // Batch Control Total break; case '9': // File Control Record retVal.FileControl = await ProcessFileControlRecord(line); break; } } } catch { throw new NachaProcessorException(); } return(await Task.FromResult(retVal)); }
public static NachaFileFormatted ConvertToFormatted(this NachaFile file) { return(new NachaFileFormatted()); }