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
63 stars 39 forks source link

Not all images are checks #317

Open atonks2 opened 1 year ago

atonks2 commented 1 year ago

ICL files can include images that are not checks, such as deposit slips. Because they're not check images or returns, they are not preceded by a CheckDetail (type 25) or ReturnDetail (type 31) record. This library assumes that all images are associated with checks or returns, so when it encounters an image without a preceding check or return detail it returns an error.

What were you trying to do?

Upload an x937 file containing an image of a deposit ticket. The file in question is valid according to the x9.100-187_UCD-2008 specification companion document.

The file contains the following:

File Header (01)
    Cash Letter Header (10)
        Bundle Header (20)
            Credit (61)
                Image View Detail (50) - Deposit Ticket
                Image View Data (52)
                Image View Detail (50)
                Image View Data (52)
            Check Detail (25)
                Image View Detail (50) - Check 1
                Image View Data (52)
                Image View Detail (50)
                Image View Data (52)
            Check Detail (25)
                Image View Detail (50) - Check 2
                Image View Data (52)
                Image View Detail (50)
                Image View Data (52)
        Bundle Trailer (70)
    Cash Letter Control (90)
File Trailer (99)

What did you expect to see?

A successful file upload.

What did you see?

A FileError was returned from here

{"error":"error reading image cache letter: line:5 record:ImageViewDetail *imagecashletter.FileError ImageViewDetail Outside of current bundle"}

How can we reproduce the problem?

POST a file containing an image outside of a CheckDetail.

atonks2 commented 1 year ago

Essentially a duplicate of https://github.com/moov-io/imagecashletter/issues/112