moov-io / ach-test-harness

Programmatic and configurable ACH scenario testing of returns, NOC/corrections, reconciliation, etc.
Apache License 2.0
15 stars 7 forks source link

ImmediateOrigin field doesn't allow 10 digits values. #35

Closed thomasJoei closed 3 years ago

thomasJoei commented 3 years ago

Background Got a validation error when trying to produce an ACH return from an ACH file containing a 10 digits ImmediateOrigin:

 "header validate: ImmediateDestination 9999999999 invalid routing number length of 10"

As stated here https://help.imscre.net/hc/en-us/articles/360000402343-NACHA-Setup ImmediateOrigin can be 10 digits in some cases.

The "Immediate Origin", is a 9-digit number usually the company’s EIN (enter without any dashes) or A 10-digit number assigned to by the ODFI once they approve them to originate ACH files through them. If 10-digit number there is typically a number assigned to be input prior to the company’s EIN (ex. 5xxxxxxxxx).

Proposal As the ACH sub module already as validation bypassing options (https://pkg.go.dev/github.com/moov-io/ach#ValidateOpts), I propose to leverage ValidateOpts and make it available as a new object in the config.

I will open a PR with my proposed changes.

@adamdecaf Super useful project by the way ! 👏

adamdecaf commented 3 years ago

I've released v0.5.0 with this included, thanks!

https://github.com/moov-io/ach-test-harness/releases/tag/v0.5.0