mvallim / emv-qrcode

Java Based EMV QR Code Generator and Parser (MPM, CPM)
https://mvallim.github.io/emv-qrcode/
Apache License 2.0
95 stars 46 forks source link

Merchant Account Information "02" to "25" should be primitive data objects #21

Closed waggyza closed 3 years ago

waggyza commented 3 years ago

Hi, I have been provided some reserved merchant account information within the range of fields "02" to "25". The object provided is a primitive data object and not in a template. It seems in your code you are assuming "02" to "51" as Merchant Account Information Templates. However "02" to "25" are referred to in the EMVCO spec as primitive data objects.

Happy to help contribute in code. However this is an interesting structural change as "02" to "51" are all Merchant Account Information but since some return primitives and some return templates there would need to be some separation of gets, sets and adds. Maybe a getMerchantAccountInformation() for "02" to "25" and a getMerchantAccountInformationTemplates() for "26" to "51"

mvallim commented 3 years ago

Hi @waggyza,

Thanks for the contribution, your observation makes total sense.

I will mark it as a bug and follow through with the fix.

Any other point of improvement or problem, let me know.

Thanks,

mvallim commented 3 years ago

Hi @waggyza,

I used the same approach as the previous one, adding this segregation by MerchantAcountInformation Reserverd and ReserverdAdditional, in order to maintain a better compatibility with what already exists.

In the example, this is explicit. Can evaluate here

I await your suggestions.

Thanks,

waggyza commented 3 years ago

Thanks for the fast turn around @mvallim Its working as expected.