Documentation ¶
Overview ¶
bank performs BSB Number lookups to find bank and branch details
Data Source: https://bsb.auspaynet.com.au/
Index ¶
- Constants
- Variables
- type BSB
- type Branch
- type ClearingSystems
- func (cs ClearingSystems) Closed() bool
- func (cs ClearingSystems) Electronic() bool
- func (cs ClearingSystems) HighValue() bool
- func (cs ClearingSystems) MarshalJSON() ([]byte, error)
- func (cs ClearingSystems) Paper() bool
- func (cs ClearingSystems) String() string
- func (cs *ClearingSystems) UnmarshalJSON(data []byte) error
- type Institution
Constants ¶
const ( PaperClearing = 1 << iota // P=Paper (APCS) ElectronicClearing // E=Electronic (IAC) HighValueClearing // H=High Value (HVCS) )
const MaxBSB = 999999
MaxBSB is the maximum number a BSB can hold, as it's only 6 digits.
Variables ¶
var ErrBranchNotFound = errors.New("branch not found")
var ErrInvalidBSB = errors.New("invalid BSB number")
Functions ¶
This section is empty.
Types ¶
type BSB ¶
type BSB uint32
BSB is an Australian Bank State Branch number. It is a code used for domestic payments within Australia.
func NewBSB ¶
NewBSB parses a string of the BSB number and returns a valid BSB type. If the string is not a valid BSB number an error is returned.
Valid formats:
nnn-nnn example "123-456" will be 123-456 nnnnnn will convert to nnn-nnn, example "123456" will be 123-456 nnnnn will convert to 0nn-nnn, example "12345" will be 012-345 Where n is an ascii digit
func (BSB) MarshalJSON ¶
MarshalJSON marshals the BSB number into JSON format.
func (BSB) String ¶
String return the BSB number in the format nnn-nnn, where n is a digit. Example:
"123-456"
func (*BSB) UnmarshalJSON ¶
MarshalJSON unmarshal's JSON into a BSB number.
type Branch ¶
type Branch struct { BSB BSB `json:"bsb,omitempty"` Name string `json:"name,omitempty"` Bank Institution `json:"bank,omitempty"` BankCode string `json:"bank_code,omitempty"` Address string `json:"address,omitempty"` Suburb string `json:"suburb,omitempty"` State string `json:"state,omitempty"` Postcode string `json:"postcode,omitempty"` PaymentsFlags ClearingSystems `json:"payments_flags,omitempty"` }
type ClearingSystems ¶
type ClearingSystems byte
The payments flags refer to the clearing systems (frameworks) with P=Paper (APCS), E=Electronic (IAC) and H=High Value (HVCS).
const ClosedClearingSystem ClearingSystems = 0
ClosedClearingSystem is closed
func NewClearingSystems ¶
func NewClearingSystems(flags string) ClearingSystems
NewClearingSystems parses the list of flags into a ClearingSystems type. The ClearingsSystem contains all the avaliable clearing systems. If no flags are provided a Closed clearing system is returned.
func (ClearingSystems) Closed ¶
func (cs ClearingSystems) Closed() bool
Closed returns true is the clearing system is closed
func (ClearingSystems) Electronic ¶
func (cs ClearingSystems) Electronic() bool
Electronic returns true if Electronic clearing system (IAC) is avaliable
func (ClearingSystems) HighValue ¶
func (cs ClearingSystems) HighValue() bool
HighValue returns true if HighValue clearing system (HVCS) is avaliable
func (ClearingSystems) MarshalJSON ¶
func (cs ClearingSystems) MarshalJSON() ([]byte, error)
MarshalJSON marshals the ClearingSystems into JSON format.
func (ClearingSystems) Paper ¶
func (cs ClearingSystems) Paper() bool
Paper returns true if Paper clearing system (APCS) is avaliable
func (ClearingSystems) String ¶
func (cs ClearingSystems) String() string
String returns a list of the avaliable clearing systems. P=Paper (APCS), E=Electronic (IAC) and H=High Value (HVCS). An empty string is returned if closed.
func (*ClearingSystems) UnmarshalJSON ¶
func (cs *ClearingSystems) UnmarshalJSON(data []byte) error
MarshalJSON unmarshal's JSON into a ClearingSystems type.