-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconsts.go
71 lines (56 loc) · 2.87 KB
/
consts.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package mimir
// Errors
const (
// ErrIBANTooshort is the error when an 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")
// ErrABARTNInvalidLength is the error when an ABA Routing Number is too short the the validation process
ErrABARTNInvalidLength = mimirError("ABA is too short. 9 digits is expected")
// ErrABAInvalidChecksum is the error when a ABA Routing Number is invalid
ErrABAInvalidChecksum = mimirError("ABA Routing Number invalid checksum")
// ErrPaymentCardInvalidChecksum is the error when a Payment card number is invalid
ErrPaymentCardDoesNotMatchAnyIssuer = mimirError("Payment card does not match any issuer")
// ErrPaymentCardTooShort is the error when a Payment card number is too short for the validation process
ErrPaymentCardTooShort = mimirError("Payment card number is too short")
// ErrIssuerDoesNotExist is the error when you lookup for an issuer that does not exists
ErrIssuerDoesNotExist = mimirError("Issuer does not exist")
// ErrStructureNotFound is the error when you try to format a payment card which does not have supported structure
ErrStructureNotFound = mimirError("Structure not found")
)
type mimirError string
func (m mimirError) Error() string {
return string(m)
}
// IBAN - Structure digit keys
const (
AccountNumberIBANDigitKey = "a" // alphanumeric
NationalBankCodeIBANDigitKey = "b" // numeric
CountryCodeIBANDigitKey = "c" // alphabetic
CheckIBANDigitKey = "k" // checksum
NationalIdentificationNumberIBANDigitKey = "i"
CurrencyIBANDigitKey = "m" // alphanumeric
AccountHolderIBANDigitKey = "n"
ReserveNumberIBANDigitKey = "o" // always 0
BranchCodeIBANDigitKey = "s" // counter code
AccountTypeIBANDigitKey = "t"
SWIFTBICCodeIBANDigitKey = "w" // alphanumeric
NationalCheckIBANDigitKey = "x" // numeric
)
// ABA Routing Number - Structure digit keys
const (
FederalReserveRoutingSymbolABADigitKey = "f" // numeric
ABAInstitutionIdentifierDigitKey = "a" // numeric
CheckABADigitKey = "k" // checksum // numeric
)
// Payment card - Structure digit keys
//const (
// MIIPCDigitKey = "m" // numeric
// IINPCDigitKey = "i" // numeric
// AccountNumberPCDigitKey = "a" // numeric
// CheckPCDigitKey = "k" // numeric
//)