moov-io / ach

ACH implements a reader, writer, and validator for Automated Clearing House (ACH) files. The HTTP server is available in a Docker image and the Go package is available.
https://moov-io.github.io/ach/
Apache License 2.0
446 stars 149 forks source link

incorrect BatchCount is not caught by validation #1428

Open busitech opened 1 month ago

busitech commented 1 month ago

ACH Version

v1.35.1 cli

What were you trying to do?

We were trying to validate an ACH file.

What did you expect to see?

The file input to the program contained an incorrect BatchCount, which should have been shown as an error.

What did you see?

The incorrect BatchCount was not mentioned.

How can we reproduce the problem?

Send a file through the program with an incorrect BatchCount.

adamdecaf commented 1 month ago

We've historically treated the FileControl / BatchControl records as computable and haven't validated their contents strictly. Are you encountering a problem with the invalid counts? You can always call .Create() and get a properly tabulated file.

busitech commented 1 month ago

We are using this program to validate and cross-check files before submitting to the bank. The bank rejected our file as invalid after being successfully validated by the program. We expected the program to be correct.

adamdecaf commented 1 month ago

I'm not comfortable changing the default behavior to begin validating BatchCount (and other BatchControl fields) so we'd need to add a ValidateOpt for that. Can you use the Go library (or HTTP server) to create ACH files? If so both have .Create() / /build / /contents methods available which tabulate BatchControl records.

You said you're using achcli to verify prior to submission. The tool you're using as the primary seems to have a bug with calculating BatchControl fields.

busitech commented 1 month ago

Per your previous comment, this library aims to implement the Nacha spec. Does the Nacha spec allow invalid BatchCount and other BatchControl fields?

We do not use Go.

We have developed our own software for producing ACH files, and achcli has been a handy tool for validating and displaying them during the development process. We have since discovered that achcli does not correctly validate all fields.