« MBS Plugin Advent cal… | Home | Xojo Meeting in Austi… »

MBS Plugin Advent calendar: 9 - IBAN

Door 9 - IBAN

Fact of the day
Saint Lucia has the longest IBAN with 32 characters. This country is not a member of the SEPA area. Within the SEPA area, Malta has the longest IBAN with 31 characters.

Today I would like to introduce you to a component that currently only contains 7 functions, but can be very useful to you if required. We are talking about the IBAN component. The IBAN number is an international number that can be clearly assigned to a specific account. It is intended to contribute to the standardization of global payment transactions. Mainly the EU countries have already implemented this standard, but countries outside of Europe are also adopting this standard.

The structure of the IBAN depends on the country from which the IBAN originates. All IBAN numbers start with the country code, which consists of two characters. With the MBS FileMaker Plugin, you can call up a list of these country codes using the IBAN.Countries function.

The country code is then followed by a check number, which is calculated from the remaining digits. This is to support the correctness of the IBAN. The MBS FileMaker Plugin can also calculate this check number separately. To do this, enter the IBAN in the parameters and enter 00 instead of the unknown check number, which consists of two digits

Set Variable [ $Sum ; Value: MBS( "IBAN.CalcCheckSum"; DoorNine::IBAN) ] 

This is followed by a sequence of digits that can vary in length from country to country. With such a long number, it is easy to lose track. For this reason, it is practical that the plugin comes with a function that uses spaces to put the IBAN into a clearer form. Use the IBAN.Format function for this


Set Variable [ $IBAN ; Value: MBS( "IBAN.Format"; DoorNine::IBAN) ]

If we have the IBAN in a formatted form and want to remove the spaces or other characters that are not valid, the IBAN.Compact function is your tool of choice.


Set Variable [ $IBAN ; Value: MBS( "IBAN.Compact"; DoorNine::IBAN) ]

If you would like to find out more about the structure of an IBAN from a specific country, the IBAN.RegEx function provides you with a regular expression that describes the structure by specifying the appropriate country code.


Set Variable [ $reg ; Value: MBS("IBAN.RegEx"; DoorNine::Country) ] 

You can check whether an IBAN has this structure and whether the check digit matches the IBAN using the really practical IBAN.IsValid function. Here too, invalid characters are ignored when entering the IBAN.


Set Variable [ $Valid ; Value: MBS( "IBAN.IsValid"; DoorNine::IBAN) ] 
If [ $Valid ] 
	Show Custom Dialog [ "Is the IBAN valid?" ; DoorNine::IBAN & " is a valid IBAN" ] 
Else
	Show Custom Dialog [ "Is the IBAN valid?" ; DoorNine::IBAN & " is not a valid IBAN" ] 
End If

If you would like to save the IBAN in your database, it is recommended that you first use the IBAN.Compact function.

If you would like to experiment a little with the individual IBANs of the countries, you can use IBAN.Example to obtain an example IBAN for the appropriate country.

Set Variable [ $IBAN ; Value: MBS("IBAN.Example"; DoorNine::Country) ] 
If [ MBS("IBAN.IsValid"; $IBAN) ] 
	Set Field [ DoorNine::IBAN ; $IBAN ] 
Else
	Show Custom Dialog [ "Error" ; $IBAN ] 
End If

I hope you enjoyed this excursion into the world of banking and that you can use some of it in your projects.


Monkeybread Software Logo with Monkey with Santa hat
8 👈 9 of 24 👉 10
09 12 23 - 09:25