Tochemey / NetCore8583

NetCore8583 is a library that helps parse/read and generate ISO 8583 messages for .NET Core
MIT License
30 stars 19 forks source link

Fields with decimals throws an error #20

Closed Ricky-G closed 8 months ago

Ricky-G commented 9 months ago

If we have decimals in the field num's then we get an exception. This is a 'valid' ISO message scenario, for example in Postilion Payment Switch interface they do have this a lot and we need to cater for this.

To Reproduce Use below config file

<?xml version="1.0" encoding="UTF-8"?>

<n8583-config>

    <header type="0100">0100</header>

  <template type="0100">        
        <!-- Original Card Acceptor ID Code -->
        <field num="127.48" type="LLLVAR" />
        <!-- Dynamic Currency Conversion (DCC) status code -->
        <field num="127.49" type="LLLVAR" />
        <!-- Card Acceptor Additional Data -->
        <field num="127.59" type="LLLVAR" />
        <!-- Payment Token Identifier -->

    </template>

</n8583-config>

Expected Result Works the same as if it was an integer

Observed Result Logger.Error($"ISO8583 Cannot parse XML configuration {e}");

image
Tochemey commented 9 months ago

@Ricky-G I will take a look. Thanks for reporting this. Hopefully I can come up with fix in the weekend.

Tochemey commented 9 months ago

@Ricky-G do you mind sharing your iso spec? Per the iso8583 standard here: https://en.wikipedia.org/wiki/ISO_8583, I cannot see any decimal data field.

Tochemey commented 9 months ago

@Ricky-G I believe this is what you are looking for https://github.com/Tochemey/NetCore8583#composite-fields to handle the field number 127 in your scenario

Tochemey commented 8 months ago

@Ricky-G closing this issue because there is no activity. I have not received any feedback from you. Feel free to reopen it