swico / www.swiss-qr-invoice.org

Website for Swiss QR Invoice organization.
https://www.swiss-qr-invoice.org
11 stars 1 forks source link

Validation error when parsing a qr bill with voucher number "11" #13

Open aschi opened 4 years ago

aschi commented 4 years ago

A customer of ours was testing a few qr bills with your validator. At the 11th bill they encountered an error that worried them (I recreated the issue with meaningless "test data"):

image

According to the six specification (https://www.paymentstandards.ch/dam/downloads/ig-qr-bill-en.pdf page 52) "free text" is allowed as voucher number (e.g. "11" should be valid). Will this lead to any further inconveniences or is this just a minor issue with your validator?

epsitec commented 4 years ago

@aschi thank you for your submission. I am afraid that you are trying to use 11/11/200727 as the voucher number (element /10/) but that you forgot to escape the /, which can't appear as such in the value of an element. If you want to do this right, you should use this string instead:

//S1/10/11\/11\/200727

or else the string will be interpreted as :

aschi commented 4 years ago

Thank you for your reply. This is correct. The way we would like it to be interpreted is:

As far as I have seen in the validator source code, it searches for /10/, /11/, ... in the input string and checks if the following value is valid for the given type:

In our example: //S1/10/11/11/200727

epsitec commented 4 years ago

Sorry, I misunderstood what you were trying to do. You are right. There seems to be an issue in the validator!