Documentation
¶
Index ¶
- Constants
- func FormatIBAN(iban string) (string, error)
- func GetCheckDigits(iban string) (string, string, error)
- func GetCountryConfiguration(countryCode string) (*configuration, error)
- func IsIBANValid(iban string) error
- func PrintFormatIBAN(iban string) (string, error)
- func SplitIBAN(iban string) ([]string, []string, error)
Constants ¶
const ( // ErrIBANTooshort is the error when a IBAN is too short for the validation process ErrIBANTooshort = mimirError("IBAN is too short") // ErrIBANIncorrectLength is the error when a IBAN does not have the required length ErrIBANIncorrectLength = mimirError("IBAN incorrect length") // ErrIBANInvalidChecksum is the error when a IBAN is invalid ErrIBANInvalidChecksum = mimirError("IBAN invalid checksum") // ErrCountryCodeDoesNotExist is the error when you lookup for a country code that does not exists ErrCountryCodeDoesNotExist = mimirError("Country Code does not exist") )
Errors
const ( AccountNumberDigitKey = "a" // alphanumeric NationalBankCodeDigitKey = "b" // numeric CountryCodeDigitKey = "c" // alphabetic CheckDigitKey = "k" // checksum NationalIdentificationNumberDigitKey = "i" CurrencyDigitKey = "m" // alphanumeric AccountHolderDigitKey = "n" ReserveNumberDigitKey = "o" // always 0 BranchCodeDigitKey = "s" // counter code AccountTypeDigitKey = "t" SWIFTBICCodeDigitKey = "w" // alphanumeric NationalCheckDigitKey = "x" // numeric )
Structure digit keys
Variables ¶
This section is empty.
Functions ¶
func FormatIBAN ¶ added in v0.5.0
FormatIBAN formats the given IBAN with the different parts that are defined in its structure.
func GetCheckDigits ¶ added in v0.1.1
GetCheckDigits compute the check digits from a given IBAN. Returns the computed digits, the IBAN set with the check digits or an error if something goes wrong.
func GetCountryConfiguration ¶ added in v0.1.1
GetCountryConfiguration returns ISO 13616-Compliant IBAN Formats from a given country code If the countryCode does not exist in the list, returns an error `ErrCountryCodeDoesNotExist`
func IsIBANValid ¶
IsIBANValid checks if the given IBAN is valid based on the country its belong to.
func PrintFormatIBAN ¶ added in v0.2.0
PrintFormatIBAN formats the given IBAN based on the regular way to print it depending the country. It will use the PrintFormat of the configuration to insure the result.
Types ¶
This section is empty.