Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrValidation = errors.New("validation error")
ErrValidation represents an IBAN validation error
Functions ¶
func Generate ¶ added in v1.1.5
Generate IBAN based on ISO 3166-1 country code
Example ¶
package main import ( "fmt" "github.com/jacoelho/banking/iban" ) func main() { // Validate an iban using country specific validate function result, _ := iban.Generate("GB") fmt.Println(result) }
Output:
func IsSEPA ¶ added in v1.1.34
IsSEPA returns if an iban country is a SEPA member
Example ¶
package main import ( "fmt" "github.com/jacoelho/banking/iban" ) func main() { // IsSEPA returns if an iban country is a SEPA member result, _ := iban.IsSEPA("GB29NWBK60161331926819") fmt.Println(result) }
Output: true
func IsSEPACountryCode ¶ added in v1.1.34
IsSEPACountryCode returns if a country code is a SEPA member
Example ¶
package main import ( "fmt" "github.com/jacoelho/banking/iban" ) func main() { // IsSEPACountry returns if a country is a SEPA member result, _ := iban.IsSEPACountryCode("AE") fmt.Println(result) }
Output: false
func PaperFormat ¶ added in v1.1.10
PaperFormat returns iban in paper format Follows EBS 204 - 5 IBAN Format 2) Paper Format
Example ¶
package main import ( "fmt" "github.com/jacoelho/banking/iban" ) func main() { // Pretty print an iban fmt.Println(iban.PaperFormat("GB29NWBK60161331926819")) }
Output: GB29 NWBK 6016 1331 9268 19
func ReplaceChecksum ¶ added in v1.1.5
ReplaceChecksum returns input iban with the correct check digits
Example ¶
package main import ( "fmt" "github.com/jacoelho/banking/iban" ) func main() { // Replace an iban checksum result, _ := iban.ReplaceChecksum("GB99NWBK60161331926819") fmt.Println(result) }
Output: GB29NWBK60161331926819
Types ¶
type BBAN ¶ added in v1.1.9
type BBAN struct { BBAN string BankCode string BranchCode string NationalChecksum string AccountNumber string }
BBAN is short for Basic Bank Account Number It represents a country-specific bank account number.
func GetBBAN ¶ added in v1.1.9
GetBBAN retrieves BBAN from an iban
Example ¶
package main import ( "fmt" "github.com/jacoelho/banking/iban" ) func main() { // Get BBAN from IBAN result, _ := iban.GetBBAN("GB29NWBK60161331926819") fmt.Println(result.BBAN, result.BankCode, result.BranchCode, result.AccountNumber) }
Output: NWBK60161331926819 NWBK 601613 31926819
Source Files
¶
- bban.go
- bban_helper.go
- checksum.go
- country_albania.go
- country_andorra.go
- country_austria.go
- country_belarus.go
- country_belgium.go
- country_bosnia_and_herzegovina.go
- country_brazil.go
- country_british_virgin_islands.go
- country_bulgaria.go
- country_burundi.go
- country_constants.go
- country_costa_rica.go
- country_croatia.go
- country_cyprus.go
- country_czech_republic.go
- country_denmark.go
- country_djibouti.go
- country_dominican_republic.go
- country_egypt.go
- country_el_salvador.go
- country_estonia.go
- country_falkland_islands.go
- country_faroe_islands.go
- country_finland.go
- country_france.go
- country_french_guyana.go
- country_french_polynesia.go
- country_french_southern_territories.go
- country_georgia.go
- country_germany.go
- country_gibraltar.go
- country_greece.go
- country_greenland.go
- country_guadeloupe.go
- country_guatemala.go
- country_honduras.go
- country_hungary.go
- country_iceland.go
- country_iraq.go
- country_ireland.go
- country_israel.go
- country_italy.go
- country_jordan.go
- country_kazakhstan.go
- country_kingdom_of_bahrain.go
- country_kuwait.go
- country_latvia.go
- country_lebanon.go
- country_libya.go
- country_lithuania.go
- country_luxembourg.go
- country_macedonia.go
- country_malta.go
- country_martinique.go
- country_mauritania.go
- country_mauritius.go
- country_mayotte.go
- country_moldova.go
- country_monaco.go
- country_mongolia.go
- country_montenegro.go
- country_new_caledonia.go
- country_nicaragua.go
- country_norway.go
- country_oman.go
- country_pakistan.go
- country_poland.go
- country_portugal.go
- country_principality_of_liechtenstein.go
- country_qatar.go
- country_republic_of_azerbaijan.go
- country_republic_of_kosovo.go
- country_reunion.go
- country_romania.go
- country_russia.go
- country_saint_barthelemy.go
- country_saint_lucia.go
- country_saint_martin.go
- country_saint_pierre_et_miquelon.go
- country_san_marino.go
- country_sao_tome_and_principe.go
- country_saudi_arabia.go
- country_serbia.go
- country_seychelles.go
- country_slovak_republic.go
- country_slovenia.go
- country_somalia.go
- country_spain.go
- country_state_of_palestine.go
- country_sudan.go
- country_sweden.go
- country_switzerland.go
- country_the_netherlands.go
- country_timor_leste.go
- country_tunisia.go
- country_turkey.go
- country_ukraine.go
- country_united_arab_emirates.go
- country_united_kingdom.go
- country_vatican_city_state.go
- country_wallis_and_futuna_islands.go
- country_yemen.go
- error.go
- generate.go
- iban.go
- sepa.go
- validate.go
Click to show internal directories.
Click to hide internal directories.