Closed vxio closed 3 years ago
Potential implementation: add this as an option in ValidateOpts
to bypass the error.
Another implementation for this could be:
fh := ach.NewFileHeader()
// fill in fields
fc := ach.NewFileControl()
// fill in fields (tricky with EntryHash, etc)
var buf bytes.Buffer
buf.WriteString(fh.String() + "\n")
buf.WriteString(fc.String() + "\n")
// ioutil.WriteFile(path, buf.Bytes(), 0644)
This would create a two-line file with the fields properly padded. I'm not sure how the file needs to match up with the Nacha spec (e.g. 10 lines with padding, etc)
@adamdecaf That is exactly what I was going to recommend when I saw the thread in Slack.
Appreciate the ideas! The Slack member mentioned he's using the HTTP server, so we'll need to enable this there.
What were you trying to do? Write an empty
File
with a file header and control usingNewWriter(io.Writer).Write(f *File)
What did you expect to see The ACH file written to
io.Writer
What did you see? Error: BatchCount calculated 0 is out-of-balance with file control 1
What's the use-case? An FI wants an empty file with a file header/control and no transactions to be able to confirm that a communication path with the originator is alive.