[x] Bug
[ ] Question (e.g. about handling/usage)
[ ] Request for new feature/improvement
Expected Behavior
Valid IBANs such as CH47048350000GABRIELS can generate a QRCode
Current Behavior
Currently calling new PayloadGenerator.SwissQrCode.Iban(iban, PayloadGenerator.SwissQrCode.Iban.IbanType.Iban) throws an error (The IBAN entered isn't valid.)
Possible Solution (optional)
private static bool PieceWiseCalculationForValidation(string ibanString)
{
string currentlyProcessingIbanString = ibanString.Substring(0, 9);
string ibanStringStrippedOfPrevious = ibanString.Substring(9);
int? n = null;
while (!string.IsNullOrEmpty(currentlyProcessingIbanString) && int.TryParse(n != null ? n + currentlyProcessingIbanString : currentlyProcessingIbanString, NumberStyles.Any, CultureInfo.InvariantCulture, out int currentlyProcessingNumberFromIbanString))
{
n = currentlyProcessingNumberFromIbanString % 97;
int remainingSubstringLength = ibanStringStrippedOfPrevious.Length < 7 ? ibanStringStrippedOfPrevious.Length : 7;
currentlyProcessingIbanString = ibanStringStrippedOfPrevious.Substring(0, remainingSubstringLength);
ibanStringStrippedOfPrevious = ibanStringStrippedOfPrevious.Substring(remainingSubstringLength);
}
return n == 1;
}
Steps to Reproduce (for bugs)
new PayloadGenerator.SwissQrCode.Iban("CH47048350000GABRIELS ", PayloadGenerator.SwissQrCode.Iban.IbanType.Iban)
Type of issue
[x] Bug
[ ] Question (e.g. about handling/usage)
[ ] Request for new feature/improvement
Expected Behavior
Valid IBANs such as CH47048350000GABRIELS can generate a QRCode
Current Behavior
Currently calling new PayloadGenerator.SwissQrCode.Iban(iban, PayloadGenerator.SwissQrCode.Iban.IbanType.Iban) throws an error (The IBAN entered isn't valid.)
Possible Solution (optional)
Steps to Reproduce (for bugs)
Your Environment