Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Format Support - variable binary field within first 127 fields #124

Open
arajput opened this issue Aug 27, 2022 · 3 comments
Open

Comments

@arajput
Copy link

arajput commented Aug 27, 2022

First thanks for this awesome library.
I am using this for some IFSF messages encode/decode at client side application.
i have some custom requirement t support subfields at 48 position. It has bitmap + 48.1, 48.2, 48.3 ... very much same as 127.25
i can not use "LLLVAR ans" because it is at host side the field content is treated as binary similar to fixed binary field.

here is test case attached for the above requirement.

import test from 'ava';
import iso8583 from '../lib/8583.js';

/*
Support custom iso 8583 formats
Support Case: Binary var field encode decode
*/
test('iso8583 Ext - binary var field must be encoded', t => {
  const format = {
    2: {
      ContentType: 'b',
      Label: 'F1',
      LenType: 'llvar',
      MaxLen: 99
    },
        
  };
  const data = {
    0: '0800',
    '2': '1004000000000000303030303030303030343048' 
    // #2 is prepard by encodng subfields - 8bytes bitmap followed by subfields data
  };
  let isopack = new iso8583(data, format);
  let buff = isopack.getRawMessage();
  const iso1 = new iso8583(undefined, format).getIsoJSON(buff, {lenHeader: false});
  t.deepEqual(iso1, data);
  let isopack1 = new iso8583(iso1);
  t.is(isopack1.Msg['2'], '1004000000000000303030303030303030343048');
});
@arajput arajput changed the title Custom Format Support - Binary variable field within first 127 fields Custom Format Support - variable binary field within first 127 fields Aug 27, 2022
@arajput
Copy link
Author

arajput commented Aug 27, 2022

Please see my observation in the code.
Screen Shot 2022-08-27 at 9 06 56 AM

@arajput
Copy link
Author

arajput commented Aug 27, 2022

i have following commit that has helped me for my case
arajput@54dc08b

@zemuldo
Copy link
Owner

zemuldo commented Aug 30, 2022

I will check this over the weekend. I am happy to review a pull request if you send it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants