Skip to content

Girocode / PayloadGenerator, BIC validation errors when not passed in to Girocode constructor, with SCT version set to 2 #582

Closed

Description

@Mies75

Type of issue

[x] Bug
[ ] Question (e.g. about handling/usage)
[ ] Request for new feature/improvement

Expected Behavior

A new instance of Girocode should not throw a nullrefexception or return validation errors when BIC is not supplied and SCT version is set to Girocode.GirocodeVersion.Version2.

Current Behavior

BIC is validated regardless of Girocode.GirocodeVersion. When not supplied a null ref occurs on
_iban = iban.Replace(" ", "").ToUpper();

Possible Solution (optional)

Always validate BIC when Girocode.GirocodeVersion.Version1.
Only validate BIC when Girocode.GirocodeVersion.Version2 and BIC is supplied.

Steps to Reproduce (for bugs)

var payload = new Girocode(iban:"NL86INGB0002445588", bic: null, name: "a name", remittanceInformation: "some info", amount: 1337.99m, version: Girocode.GirocodeVersion.Version2, encoding: Girocode.GirocodeEncoding.UTF_8);

Your Environment

  • Version used: 1.6.0
  • Compiled from source or NuGet package?: NuGet package
  • Payload/Encoded text: see example
  • Used payload generator: Girocode
  • Used ECC-level: 15
  • Used renderer class: Base64QRCode
  • Environment (.NET 3.5, .NET 4.X, .NETCore, ...): NET8

Activity

  1. added this to the 1.7.0 milestone on Oct 2, 2025
  2. linked a pull request that will close this issueFix: Make BIC optional for Girocode Version 2 #622on Oct 2, 2025
  3. Shane32 commented on Oct 2, 2025

    @Shane32
    Owner

    @Mies75 Please check the linked PR and see if it contains the correct fix so I can merge it in - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions