Closed diogomaximo closed 10 years ago
Diogo, thank you for using my library. Exactly, as now, the library gives you the exact value for the data element. As you can see, if you need a HEX value you must convert it manually. I can add (or you can propose) an update to include a function that takes a decimal numeric value as input, and returns a HEX or BIN conversion of it. If you see the ISOHelper class, there are methods to convert from BIN to HEX and from HEX to BIN. In JPOS's case, it gives you a 10 length value but the HEX value is obviously not 10 in length (as with the original value) which is an inconsistency.
Congratulations for the project. I'm trying to make an example comparing the output with a Java-based (jpos) solution. The ISO result message is a little different, I think because you are not formatting the content to HEXA.
Params. MIT -> 1810 Bit 03 -> 123 Bit 04 -> 12300 Bit 34 -> 1231321321
Objective-C Code [isoMessage1 setMTI:@"1810"]; isoMessage1.bitmap = [[ISOBitmap alloc] initWithGivenDataElements:@[@"DE03",@"DE04",@"DE34"] configFileName:nil]; [isoMessage1 addDataElement:@"DE03" withValue:@"123" configFileName:nil]; [isoMessage1 addDataElement:@"DE04" withValue:@"12300" configFileName:nil]; [isoMessage1 addDataElement:@"DE34" withValue:@"1231321321" configFileName:nil]; NSString *theBuiltMessage = [isoMessage1 buildIsoMessage:nil];
Output with JPOS. 1810 //MIT 3000000040000000 //BitMap 000123 //03 000000012300 //04 10 31323331333231333231 //34
Output with Objective-ISO8583 1810 //OK 3000000040000000 //OK 000123 //OK 000000012300 //OK 10 1231321321 //DIFFERENT