zemuldo / iso_8583

:credit_card::moneybag: JavaScript library for iso 8583 messaging. Handles message validation & conversion between interfaces using iso 8583 standard. Contributors are welcome.
https://zemuldo.github.io/iso_8583/
MIT License
89 stars 54 forks source link

User-defined ISO8583 formats support #8

Closed timgabets closed 6 years ago

timgabets commented 6 years ago

As we all know, there are tons of different flavours of ISO8583, but currently the format specification is harcoded in formats.js

I think it would be generally a good idea to implement a user-defined ISO8583 customizations support in the library. Probably, from the user's point of view it may look like this:


// Create the new ISO8583 format, which will be exact the same 
// as the default one from lib/formats.js, 
// but with the different DE12 (n6 type changed to n12):
let format = {
  12: {
        ContentType: "n",
        Label: "Time, local transaction (hhmmss)",
        LenType: "fixed",
        MaxLen: 12
    },
}
let isopack = new iso8583(data, format);

I think this will make the library more flexible and customizable.

Any thoughts/ideas are welcome ;)

If you are okay with that, I'll start the development soon.

zemuldo commented 6 years ago

This is an awesome idea. just loop me where u feel like. it makes tatal sense for somebody to define their formats.

On Dec 20, 2017 6:08 PM, "Tim Gabets" notifications@github.com wrote:

As we all know, there are tons of different flavours of ISO8583, but currently, the format specification is harcoded in formats.js https://github.com/zemuldo/iso_8583/blob/master/lib/formats.js

I think it would be generally a good idea to implement a user-defined ISO8583 customizations support in the library. Probably, from the user's point of view it may look like this:

// Create the new ISO8583 format, which will be exact the same // as the default one from lib/formats.js, // but with the different DE12 (n6 type changed to n12):let format = { 12: { ContentType: "n", Label: "Time, local transaction (hhmmss)", LenType: "fixed", MaxLen: 12 }, }let isopack = new iso8583(data, format);

I think this will make the library more flexible and customizable.

Any thoughts/ideas are welcome ;)

If you are okay with that, I'll start the development soon.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/zemuldo/iso_8583/issues/8, or mute the thread https://github.com/notifications/unsubscribe-auth/ATB9ZS2zvmg_EH9zWOVg27iTynCcHiGOks5tCSLVgaJpZM4RIhZt .

pablomarambio commented 6 years ago

Are you guys working on this idea? Is this available on a branch or on a repository I can take a look at?

zemuldo commented 6 years ago

@pablomarambio I am working on this. It will be available in the update coming end week.

zemuldo commented 6 years ago

@pablomarambio Hi, I have published a new version that supports this. I worked directly on master coz of time. Check it out

pablomarambio commented 6 years ago

@zemuldo thanks! will do

zemuldo commented 6 years ago

@timgabets Have u checked the custom iso formats?

zemuldo commented 6 years ago

@timgabets @pablomarambio Am closing this issue coz i believe it has been resolved

kunalkaskar commented 5 years ago

@zemuldo Hi I think the issue is still there following is my code. I think it is specific to Bitmap. When I try to change ContentType from 'b' to 'an' it does not effect.

let customFormats = {
    '1': {
        ContentType: 'an',
        Label: 'Bitmap',
        LenType: 'fixed',
        MaxLen: 8
    }
};
const isopack = new iso8583(data, customFormats); 
zemuldo commented 5 years ago

@kunalkaskar I would recommend you open another issue so that we better understand and solve your issue together.