moov-io / imagecashletter

X9’s Specifications for ICL (Image Cash Letter) to provide Check 21 services. The HTTP server is available in a Docker image and the Go package is available.
https://moov-io.github.io/imagecashletter/
Apache License 2.0
60 stars 39 forks source link

Cash Letter / Bundle trailers missing #140

Open neilmanley opened 3 years ago

neilmanley commented 3 years ago

What were you trying to do? Create an imagecashletter that could be validated by our partner bank to make sure we're generating the correct Check21 images for mobile deposits.

What did you expect to see? According to our partner bank:

The test file could be read, but we found a few issues:

  1. The Bundle trailer is not filled in so it will not balance
  2. The Cash Letter trailer is not filled in so it will not balance

What did you see? The file was missing a Bundle trailer and a Cash Letter trailer - not 100% sure what those are supposed to represent. I did find this white paper from X9assist: https://x9ware.com/wp-content/uploads/2016/07/x9-File-Editing-White-Paper.pdf but won't claim to understand everything I read.

How can we reproduce the problem? Not entirely sure - we didn't get a ton of information back other than what is quoted above.

adamdecaf commented 3 years ago

I'm seeing trailer records as being added in X9.100-180 which we originally didn't support.

X9.100-180 was published in 2006 with the intention to address many of the business requirements that were identified with the DSTU. The biggest desirable change was the ability to support credits, along with separate debit and credit totals in trailer records. Unfortunately, the various record types and fields within X9.100-180 became so different from the DSTU that adoption of this standard became extremely difficult. The X9.100-187 UCD was the industry response to X9.100-180, allowing specific needs to be addressed in more straight forward ways. As a result, X9.100-180 is largely unused by most financial institutions. X9Ware provides support for X9.100-180-2006 and X9.100-180-2016.

Source: https://x9ware.com/x937-specifications/

neilmanley commented 3 years ago

@adamdecaf 🤞 "originally didn't support" means you currently do support it (or it's on the roadmap)?

adamdecaf commented 3 years ago

We need to read over that spec and others that mention trailers to come up with a design/structs to implement. Previously we talked about explicit version declaration in the Reader/Writer which would be useful here, but we didn't implement that. Instead the ReaderOption/WriterOption types were added.

This change looks to be something version related, so versions outside of X9.100-180 should reject these trailer records? X9.100-187 UCD might be better to support after reading the last sentence.

As a result, X9.100-180 is largely unused by most financial institutions.

zbruhnke commented 3 years ago

@adamdecaf We have been explicitly told this should be an X9.37 file - where are you reading this about the trailers ... because we were told explicitly NOT to use an X9.100 spec

atonks2 commented 3 years ago

Hey @zbruhnke and @neilmanley I've spent some time today researching this and it seems like the "trailer" records indicated by your partner bank are simply the Control records that are required in every file (seemingly regardless of the microversion).

From that x9ware document you shared:

X9.37 files contain a series of record types which are used to build their overall structure. Each file begins with a file header (type 01) and ends with a file trailer (99). Each file can contain one or more cash letters, which begin with a cash letter header (type 10) and end with a cash letter trailer (type 90). Each cash letter can contain one or more bundles, each of which begins with a bundle header (type 20) and ends with a bundle trailer (record type 70).

According to a couple ANSI specs and the FRB, these are record types:

Can either of you share more information about the file you created? Better yet, if the file doesn't contain PII or other sensitive data can you attach the file here or send it to me in Slack?