IBAN generation and validation

2
Hi all, For a client I need to implement an IBAN generator and validator. Looking at the forum I only found a nice (very extensive) regex which can cater for validation. I also found the Java library iban4j on GitHub, which can do exactly what I need. I am a bit suprised that there is no mention here on the forum about this Java library, since I know a lot of Mendix clients are also in the banking and insurance sector. Does anybody have experience with implementing the iban4j library in Mendix? Are there other (better) solutions for implementing IBAN validation and generation?   Let me know, thanks!  
asked
3 answers
5

I packed my iban4j java library implementation in an AppStore module, the IBAN Module:

https://appstore.home.mendix.com/link/app/52954/First-Consulting/IBAN-Module

answered
0

Since IBAN check is very simple you can do it with some simple Java code:

		// BEGIN USER CODE
		// verwijder alle tekens die geen cijfers zijn 
		bankaccountnr = bankaccountnr.replaceAll( "[^\\d]", "" );
		int aantal_tekens = bankaccountnr.length(); 
		int som = 0; 
		// loop door de 9 cijfers met de 11 proef formule 
		for (int i = 1; i < 10; i++) 
		{
			int getal = Integer.parseInt(Character.toString(bankaccountnr.charAt(i-1)));
			som+=getal*(10-i); 
		} 
		// geef resultaat van check terug 
		if (som % 11 == 0 && aantal_tekens == 9) 
		{ 
			return true;
		} 
		else 
		{ 
			return false;
		} 
		
		
		

Regards,

Ronald

answered
0

Ok, thanks all for the response. I implemented the iban4j Java library and it also validates against country specific formats

answered