glenselle / nACH2

nACH is a highly customizable Node.js module exposing a high & low-level API for generating ACH files for use within the ACH network
64 stars 75 forks source link

creating batches #7

Closed yawetse closed 9 years ago

yawetse commented 9 years ago

hey guys, i keep getting and error related to ABA number validation "The ABA routing number 02120002 is 8-digits long, but it should be 9-digits long."

when add batches to a file, is the checkdigit automatically calculated, or do I need to add it manually cc @joshjersey

glenselle commented 9 years ago

It should be calculated automatically. That should be done with the computeCheckDigit function in utils.js. Running your number through does yield the check digit:

computeCheckDigit("02120002") // "021200025"
glenselle commented 9 years ago

Can you show your usage? Where are you giving it that routing number? Without knowing where you're passing that value, it's hard to figure out what might be happening.

yawetse commented 9 years ago

yeah, it may be easier to just show you my screen, but i'm actually using data from your test script.

I used https://github.com/zipline/nACH/blob/master/test.js to generate generate a saved file (which is just the achFile object saved to a file). it looks something like this:

dummydata2.js | uploaded via ZenHub

I know that script works because it does generate an outputted text file

NACHA.txt | uploaded via ZenHub

but the short answer is, the account number is: 28107355, ref: "The ABA routing number 28107355 is 8-digits long, but it should be 9-digits long."

glenselle commented 9 years ago

Are you passing 02120002 in for the receivingDFI property of an entry? That might make sense. We may only be computing the check digit for immediateDestination. Which is an easy fix.

yawetse commented 9 years ago

nice! good catch.

that would be a very helpful addition. I'm also passing it as a originatingDFI

glenselle commented 9 years ago

Ok, I'll take a look at this & your pull request

yawetse commented 9 years ago

sweet, I made a a quick PR. I'm also taking a look at the Entry, you guys added a fix, I'm going to start a different issue thread on it.

thank you for being so on top of this and responsive.

glenselle commented 9 years ago

I'm closing this. Issue #9 addresses support for 8-digit routing numbers