-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcountries.go
76 lines (72 loc) · 1.7 KB
/
countries.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
72
73
74
75
76
package account
// Country type represents supported countries list by the API.
// It ensures correct country codes are used.
// Has Bank ID Codes linked to the country.
/////
// Have chosen to have this custom implementation
// as were there no package which would fulfill ISO 3166.
// Additionally this provided the opportunity to group countries with Bank ID Codes.
/////
type Country string
// List of countries supported by Form3
const (
UnitedKingdom Country = "GB"
Australia = "AU"
Belgium = "BE"
Canada = "CA"
France = "FR"
Germany = "DE"
Greece = "GR"
HongKong = "HK"
Italy = "IT"
Luxembourg = "LU"
Netherlands = "NL"
Poland = "PL"
Portugal = "PT"
Spain = "ES"
Switzerland = "CH"
UnitedStates = "US"
)
// Code returns string representation of ISO 3166 country code.
func (country Country) Code() string {
return string(country)
}
// BankIDCode returns associated Bank ID Code for given country
func (country Country) BankIDCode() string {
var code string
switch country {
case UnitedKingdom:
code = "GBDSC"
case Australia:
code = "AUBSB"
case Belgium:
code = "BE"
case Canada:
code = "CACPA"
case France:
code = "FR"
case Germany:
code = "DEBLZ"
case Greece:
code = "GRBIC"
case HongKong:
code = "HKNCC"
case Italy:
code = "ITNCC"
case Luxembourg:
code = "LULUX"
case Netherlands:
code = ""
case Poland:
code = "PLKNR"
case Portugal:
code = "PTNCC"
case Spain:
code = "ESNCC"
case Switzerland:
code = "CHBCC"
case UnitedStates:
code = "USABA"
}
return code
}