card-messages is an independent Rust library for streaming Mastercard IPM
(Integrated Product Message) clearing files. It reads VBS streams, optionally
removes 1014-byte blocking, and parses binary-bitmap ISO 8583 records without
discarding their original bytes.
use std::fs::File;
use card_messages::{IpmReader, ReaderOptions};
let file = File::open("clearing.ipm")?;
for record in IpmReader::new(file, ReaderOptions::default()) {
println!("{:?}", record?);
}
# Ok::<(), Box<dyn std::error::Error>>(())The defaults match typical IPM interchange: 1014-byte blocking, EBCDIC CP500
text, a 6000-byte maximum VBS record length, and strict validation. See
VALIDATION.md for ValidationPolicy, ParseError vs
ValidationIssue, and post-parse validators.
Message::raw_record() and Message::raw_data_element() expose the original
wire representation. PDS values remain ordered binary values, including
duplicates, and text decoding is explicit. Typed views are available for DE3,
DE22, DE30, DE31, DE54, DE55, DE63, and DE105. MessageValidator and
LogicalFileValidator provide profile and logical-file validation separately
from framing and structural parsing.
Supported text encodings are Latin-1, EBCDIC CP037, CP500, CP1140, and CP1145.
Custom ISO 8583 data-element layouts can be loaded from YAML; the bundled
reference config/ipm_field_spec.yml matches the
built-in table and includes an informational title per data element. See
config/README.md.
- PARSER_SCOPE.md: supported parser subset and field-spec YAML.
- VALIDATION.md: validation policies, errors, and validator usage.
[examples/README.md](./examples/README.md) contains runnable commands for
strict reading, every transport/encoding option, global and selective
tolerance, lossless inspection, message-profile validation, and incremental
logical-file validation.
card-messages is at version 0.1.0. The public API may change as the library
matures toward 1.0; no legacy API compatibility is promised at this stage.
This project draws inspiration from cardutil,
created by Anthony Delosa. For Python projects, consider using cardutil.
This project is not affiliated with, endorsed by, or sponsored by Mastercard International Incorporated or any payment network. It is maintained independently by its contributors.
Mastercard is a registered trademark of Mastercard International Incorporated. Other names, acronyms, and formats mentioned in this repository (such as IPM and ISO 8583) are the property of their respective owners and are used here only to describe the formats this software aims to read.
This software is provided "as is", without warranty of any kind. It is not certified for production clearing, does not guarantee compliance with Mastercard or other network specifications, and does not replace official documentation or accredited testing. You are solely responsible for how you use it and for meeting your own regulatory and scheme obligations.
MIT