Skip to content

Compare: Advanced usage Payload generators

Showing with 47 additions and 17 deletions.
  1. +7 −14 Advanced-usage---Payload-generators.md
  2. +4 −1 Advanced-usage---QR-Code-renderers.md
  3. +36 −2 Release-Notes.md
21 changes: 7 additions & 14 deletions Advanced-usage---Payload-generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,10 @@ Use this payload type if you want to share payment contact information and/or ba
#### How to use it - simple way

```csharp
Girocode generator = new Girocode("DE33100205000001194700", "BFSWDE33BER", "Uncyclomedia", 1337.99m);
string payload = generator.ToString();
var payload = new Girocode("DE33100205000001194700", "BFSWDE33BER", "Uncyclomedia", 1337.99m);

QRCodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeData qrCodeData = qrGenerator.CreateQrCode(payload, QRCodeGenerator.ECCLevel.M);
QRCodeData qrCodeData = qrGenerator.CreateQrCode(payload);
QRCode qrCode = new QRCode(qrCodeData);
var qrCodeAsBitmap = qrCode.GetGraphic(20);
```
Expand All @@ -449,7 +448,7 @@ Description: Generates the Girocode payload with different options.
|encoding|GirocodeEncoding|GirocodeEncoding. ISO_8859_1|Encoding of the Girocode payload. Default: ISO-8859-1|

#### Good to know
**Important:** As per official specification QR codes with Girocode payloads have to be generated with ECC-Level M (15%).
**Important:** As per official specification QR codes with Girocode payloads have to be generated with ECC-Level M (15%). The necessary EccLevel is already set in the payload. Therefore, please always pass the entire payload object to the CreateQrCode function instead of calling ToString().

Girocode competes (atleast for German-speaking countries) with the Bezahlcode. Even if Girocode has less features, it is more common than Bezahlcode. So choose the right payload type in respect of your users and the features you want to use.

Expand Down Expand Up @@ -798,11 +797,6 @@ var payload = new PayloadGenerator.SlovenianUpnQr(payerName, payerAddress, payer
recipientSiModel, recipientSiReference,
code);

QRCodeData qrCodeData = qrGenerator.CreateQrCode(payload.ToString(), QRCodeGenerator.ECCLevel.M,
false, false,
QRCodeGenerator.EciMode.Iso8859_2,
15);
//or overloaded method
QRCodeData qrCodeData = qrGenerator.CreateQrCode(payload);

QRCode qrCode = new QRCode(qrCodeData);
Expand Down Expand Up @@ -894,11 +888,10 @@ SwissQrCode.AdditionalInformation additionalInformation = new SwissQrCode.Additi
SwissQrCode.Currency currency = SwissQrCode.Currency.CHF;
decimal amount = 100.25m;

SwissQrCode generator = new SwissQrCode(iban, currency, contactGeneral, additionalInformation, reference, null, amount, null, null);
string payload = generator.ToString();
SwissQrCode payload = new SwissQrCode(iban, currency, contactGeneral, additionalInformation, reference, null, amount, null, null);

QRCodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeData qrCodeData = qrGenerator.CreateQrCode(payload, QRCodeGenerator.ECCLevel.M, forceUtf8: true);
QRCodeData qrCodeData = qrGenerator.CreateQrCode(payload);
QRCode qrCode = new QRCode(qrCodeData);
var qrCodeAsBitmap = qrCode.GetGraphic(20, Color.Black, Color.White, (Bitmap)Bitmap.FromFile(Application.StartupPath + "\\CH-Kreuz_7mm.png"), 14, 1);
```
Expand Down Expand Up @@ -926,9 +919,9 @@ Description: Generates a new Swiss Qr code.

#### Good to know

- **Important:** As per official specification Swiss QR codes have to be generated with ECC-Level M (15%).
- **Important:** As per official specification Swiss QR codes have to be generated with ECC-Level M (15%). The necessary EccLevel is already set in the payload. Therefore, please always pass the entire payload object to the CreateQrCode function instead of calling ToString().
- **Important:** As per official specification a Swiss cross logo (can be downloaded [here](https://www.six-group.com/dam/download/banking-services/standardization/qr-bill/swiss-cross-graphic-en.zip)) has to be drawn on the code with a size of ~14%. (Per spec the Swiss cross has to be 7mm per side and the Swiss Qr code should be printed with 46mm without quiet zones or 49,2mm per side with quietzones. So we get 7/(49,2/100) = 14% icon size.)
- **Important:** When passing a SwissQRCode payload to the `CreateQrCode()`-function, always set the `forceUtf8`-parameter to `true`.


***

Expand Down