iban

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2023 License: MIT Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIbanTooShort          = errors.New("iban: iban too short")
	ErrCountryCodeNotUpper   = errors.New("iban: country code contains lowercase letters")
	ErrCountryCodeNotAlpha   = errors.New("iban: country code contains non alphabetic letters")
	ErrCountryCodeNotPresent = errors.New("iban: country code does not exist")
	ErrInvalidCheckDigit     = errors.New("iban: invalid check digit")
	ErrInvalidIbanModulo     = errors.New("iban: invalid modulo")
	ErrInvalidBbanLength     = errors.New("iban: invalid bban length")
	ErrInvalidBbanPart       = errors.New("iban: invalid bban part")
)

Error codes returned by failures to validate an iban.

Functions

func Validate

func Validate(value string) error

Validate validates iban code.

Types

type Iban

type Iban struct {
	// contains filtered or unexported fields
}

Iban represents iban code. Zero value is not usable.

func MustParse

func MustParse(value string) *Iban

MustParse tries to create new iban code, panics on failure.

func New

func New(value string) (*Iban, error)

New validates and creates new iban code. Deprecated: Use Parse instead.

func Parse added in v0.3.0

func Parse(value string) (*Iban, error)

Parse validates and creates new iban code.

func (*Iban) AccountNumber

func (i *Iban) AccountNumber() string

AccountNumber returns account number of iban.

func (*Iban) AccountType

func (i *Iban) AccountType() string

AccountType returns account type of iban.

func (*Iban) BankCode

func (i *Iban) BankCode() string

BankCode returns bank code of iban.

func (*Iban) Bban

func (i *Iban) Bban() string

Bban returns bban part of iban.

func (*Iban) BranchCode

func (i *Iban) BranchCode() string

BranchCode returns branch code of iban.

func (*Iban) CheckDigit

func (i *Iban) CheckDigit() string

CheckDigit returns check digit of iban.

func (*Iban) CountryCode

func (i *Iban) CountryCode() string

CountryCode returns country code of iban.

func (*Iban) Currency added in v0.2.0

func (i *Iban) Currency() string

Currency returns currency of iban.

func (*Iban) IdentificationNumber

func (i *Iban) IdentificationNumber() string

IdentificationNumber returns identification number of iban.

func (*Iban) NationalCheckDigit

func (i *Iban) NationalCheckDigit() string

NationalCheckDigit returns national check digit of iban.

func (*Iban) OwnerAccountType

func (i *Iban) OwnerAccountType() string

OwnerAccountType returns owner account type of iban.

func (*Iban) String

func (i *Iban) String() string

String returns text representation of iban.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL