codebude / QRCoder

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

Linebreak after EPD in SwissQRCode #399

Closed RamonaFrickCH closed 1 year ago

RamonaFrickCH commented 2 years ago

Discussed in https://github.com/codebude/QRCoder/discussions/398

Originally posted by **RamonaFrickCH** May 9, 2022 In Version 1.3.7 Wrote follow: [Bugfix] Fixed missing linebreak when "Bill information" in SwissQRCode is empty But on my QRCode information. I have always a linebreak. I use de Version 1.4.1 and I updated to 1.4.3 and in both version have a linebreak. Why? What I doing wrong? I have unstructureMessage with "Steuern 2021" and BillInformation is Null. After EPD should not be a line break. ![RISC-5037](https://user-images.githubusercontent.com/105198572/167363429-65e4cbb8-ed1e-442c-ac26-579588e4728e.png) ![YYQRCODE RPX BOTTOM_ca6754be9f374c8697543f7ad32dd1e7](https://user-images.githubusercontent.com/105198572/167363530-810d8268-cf7f-45f1-bd9d-d45c01c13395.png)
feis1 commented 2 years ago

I just came across the same issue. The fix https://github.com/codebude/QRCoder/issues/216 was correct back then. But in the meantime the definition of this field StrdBkgInf changed from optional to additional. That means it must only be delivered if the element is not empty. This can be looked up in the following documents: Current standard: https://www.paymentstandards.ch/dam/downloads/ig-qr-bill-en.pdf Changes from version 2.1 to 2.2: https://www.paymentstandards.ch/dam/downloads/documentation-of-changes-2.2-en.pdf

@codebude: There is a new bug, because a line break is currently always inserted after BillInformation. But this is only allowed if the field actually contains data. Please fix this, thank you.

RamonaFrickCH commented 1 year ago

In de Class PayloadGenerator.cs Line 1142 Please fix the Bug #399

// https://github.com/codebude/QRCoder/issues/399 - If BillInformation is empty, insert no linebreak SwissQrCodePayload += (!string.IsNullOrEmpty(additionalInformation.BillInformation) ? additionalInformation.BillInformation + br : string.Empty); //StrdBkgInf

codebude commented 2 months ago

Hi @RamonaFrickCH , hi @feis1 thanks for your valuable input and sorry for my really slow response time. I merged the bugfix and will release it soon with QRCoder 1.5.0.

I've seen that meanwhile the Swiss Payment Standard version 2.3 was released. Are you aware of any other breaking changes in 2.3 that might require bugfixes?