Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Apr 14, 2023. It is now read-only.

saeiddrv/ISO8583Interpreter

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An Interpreter for ISO-8583

A Java library for generating and parsing ISO-8583 financial messages. It uses the builder pattern and provides complete flexibility to provide custom decoders and encoders.

Usage

To use the library, simply create an ISO8583 object and define the fields you need. You can then set the values for each field and build the ISO-8583 message object.

Here's an example:

ISO8583 builder = ISO8583.create()
    .setCharset(StandardCharsets.ISO_8859_1)
    .setMessageLengthInterpreter(2, new HexMessageLengthInterpreter())
    .setHeader(TPDU.fromDecimal("60", "121", "121"), new TPDUHeaderInterpreter())
    .setMTI("0200", new BCDMTIInterpreter());

builder.defineField(2,
    BCD.create(LengthType.LL, 19, ContentPad.RIGHT_0)
        .setDescription("Primary Account Number")
        .setValueFormatter(new MaskCardNumber()));

// set values
builder.buildMessage().setValue(2, "6219861026599414");

// ...

Defining Fields

To define a field, use the defineField() method on your ISO8583 object. You'll need to provide the field number, data type, length, and any other necessary parameters.

For example:

builder.defineField(2,
    BCD.create(LengthType.LL, 19, ContentPad.RIGHT_0)
        .setDescription("Primary Account Number")
        .setValueFormatter(new MaskCardNumber()));

Setting Values

Once you've defined your fields, you can set their values using the setValue() method on your ISO-8583 message object.

For example:

Message message = builder.buildMessage();
message.setValue(2, "6219861026599414");

byte[] pack = message.pack();

Contributions

This project may have limitations and issues, as it has not been actively maintained and enhanced after being used as a basis for an enterprise project.

Nevertheless, Contributions are welcome! You can fork the repository and submit a pull request with your changes or open an issue to report errors.

License

This project is licensed under the MIT License.

About

An Interpreter for ISO-8583

Topics

Resources

Stars

Watchers

Forks

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.