codebude / QRCoder

A pure C# Open Source QR Code implementation
MIT License
4.46k stars 1.09k forks source link

QR-IBAN validation wrong #211

Closed gmi-root closed 4 years ago

gmi-root commented 4 years ago

When i call the following: var ibanObject = new QRCoder.PayloadGenerator.SwissQrCode.Iban("CH3908704016075473007", QRCoder.PayloadGenerator.SwissQrCode.Iban.IbanType.QrIban);

Then, no exception occurs although this is a normal IBAN and not a valid Qr-Iban. By definition, the swiss qr iban consists of a QR-IID in the range of 30000-31999 at the index 5-9 of the IBAN. Further Information you can find in this document: https://www.paymentstandards.ch/dam/downloads/qr-iid_qr-iban-de.pdf at page 6 and 9

Kind regards, gmi

codebude commented 4 years ago

Hi @gmi-root,

thanks for the valid input. You're right, this should throw an error. And it does so now. ;-) Fixed in: https://github.com/codebude/QRCoder/commit/21560a3ebef0361ee07a1a5d33e90fab75e8dda5