Documentation ¶
Index ¶
- Constants
- Variables
- func Normalize(name string) string
- func RemoveDuplicatedSpaces(name string) string
- func StripSymbols(name string) string
- func StripWaste(name string) string
- type ACHDictionary
- func (f *ACHDictionary) ACHParticipantCityFilter(achParticipants []*ACHParticipant, s string) []*ACHParticipant
- func (f *ACHDictionary) ACHParticipantPostalCodeFilter(achParticipants []*ACHParticipant, s string) []*ACHParticipant
- func (f *ACHDictionary) ACHParticipantRoutingNumberFilter(achParticipants []*ACHParticipant, s string) ([]*ACHParticipant, error)
- func (f *ACHDictionary) ACHParticipantStateFilter(achParticipants []*ACHParticipant, s string) []*ACHParticipant
- func (f *ACHDictionary) CityFilter(s string) []*ACHParticipant
- func (f *ACHDictionary) FinancialInstitutionSearch(s string, limit int) []*ACHParticipant
- func (f *ACHDictionary) FinancialInstitutionSearchSingle(s string) []*ACHParticipant
- func (f *ACHDictionary) PostalCodeFilter(s string) []*ACHParticipant
- func (f *ACHDictionary) Read(r io.Reader) error
- func (f *ACHDictionary) RoutingNumberSearch(s string, limit int) ([]*ACHParticipant, error)
- func (f *ACHDictionary) RoutingNumberSearchSingle(s string) *ACHParticipant
- func (f *ACHDictionary) StateFilter(s string) []*ACHParticipant
- type ACHLocation
- type ACHParticipant
- type RecordWrongLengthErr
- type WIREDictionary
- func (f *WIREDictionary) CityFilter(s string) []*WIREParticipant
- func (f *WIREDictionary) FinancialInstitutionSearch(s string, limit int) []*WIREParticipant
- func (f *WIREDictionary) FinancialInstitutionSearchSingle(s string) []*WIREParticipant
- func (f *WIREDictionary) Read(r io.Reader) error
- func (f *WIREDictionary) RoutingNumberSearch(s string, limit int) ([]*WIREParticipant, error)
- func (f *WIREDictionary) RoutingNumberSearchSingle(s string) *WIREParticipant
- func (f *WIREDictionary) StateFilter(s string) []*WIREParticipant
- func (f *WIREDictionary) WIREParticipantCityFilter(wireParticipants []*WIREParticipant, s string) []*WIREParticipant
- func (f *WIREDictionary) WIREParticipantRoutingNumberFilter(wireParticipants []*WIREParticipant, s string) ([]*WIREParticipant, error)
- func (f *WIREDictionary) WIREParticipantStateFilter(wireParticipants []*WIREParticipant, s string) []*WIREParticipant
- type WIRELocation
- type WIREParticipant
Constants ¶
const ( // ACHLineLength is the FedACH text file line length ACHLineLength = 155 // WIRELineLength is the FedACH text file line length WIRELineLength = 101 // MinimumRoutingNumberDigits is the minimum number of digits needed searching by routing numbers MinimumRoutingNumberDigits = 2 // MaximumRoutingNumberDigits is the maximum number of digits allowed for searching by routing number // Based on https://www.frbservices.org/EPaymentsDirectory/search.html MaximumRoutingNumberDigits = 9 )
const Version = "v0.11.1"
Version is the current version
Variables ¶
var ( // ACHJaroWinklerSimilarity is the search similarity percentage for strcmp.JaroWinkler for CustomerName // (Financial Institution Name) ACHJaroWinklerSimilarity = 0.85 // ACHLevenshteinSimilarity is the search similarity percentage for strcmp.Levenshtein for CustomerName // (Financial Institution Name) ACHLevenshteinSimilarity = 0.85 )
var ( // WIREJaroWinklerSimilarity is the search similarity percentage for strcmp.JaroWinkler for CustomerName // (Financial Institution Name) WIREJaroWinklerSimilarity = 0.85 // WIRELevenshteinSimilarity is the search similarity percentage for strcmp.Levenshtein for CustomerName // (Financial Institution Name) WIRELevenshteinSimilarity = 0.85 )
var ( ErrFileTooLong = errors.New("file exceeds maximum possible number of lines") // Similar to FEDACH site ErrRoutingNumberNumeric = errors.New("the routing number entered is not numeric") )
ErrFileTooLong is the error given when a file exceeds the maximum possible length
Functions ¶
func RemoveDuplicatedSpaces ¶ added in v0.8.0
func StripSymbols ¶ added in v0.8.0
func StripWaste ¶ added in v0.8.0
Types ¶
type ACHDictionary ¶
type ACHDictionary struct { // Participants is a list of Participant structs ACHParticipants []*ACHParticipant // IndexACHRoutingNumber creates an index of ACHParticipants keyed by ACHParticipant.RoutingNumber IndexACHRoutingNumber map[string]*ACHParticipant // IndexACHCustomerName creates an index of ACHParticipants keyed by ACHParticipant.CustomerName IndexACHCustomerName map[string][]*ACHParticipant // contains filtered or unexported fields }
ACHDictionary of Participant records
func NewACHDictionary ¶
func NewACHDictionary() *ACHDictionary
NewACHDictionary creates a ACHDictionary
func (*ACHDictionary) ACHParticipantCityFilter ¶
func (f *ACHDictionary) ACHParticipantCityFilter(achParticipants []*ACHParticipant, s string) []*ACHParticipant
ACHParticipantCityFilter filters ACHParticipant by City
func (*ACHDictionary) ACHParticipantPostalCodeFilter ¶
func (f *ACHDictionary) ACHParticipantPostalCodeFilter(achParticipants []*ACHParticipant, s string) []*ACHParticipant
ACHParticipantPostalCodeFilter filters ACHParticipant by Postal Code.
func (*ACHDictionary) ACHParticipantRoutingNumberFilter ¶
func (f *ACHDictionary) ACHParticipantRoutingNumberFilter(achParticipants []*ACHParticipant, s string) ([]*ACHParticipant, error)
ACHParticipantRoutingNumberFilter filters ACHParticipant by Routing Number
func (*ACHDictionary) ACHParticipantStateFilter ¶
func (f *ACHDictionary) ACHParticipantStateFilter(achParticipants []*ACHParticipant, s string) []*ACHParticipant
ACHParticipantStateFilter filters ACHParticipant by State.
func (*ACHDictionary) CityFilter ¶
func (f *ACHDictionary) CityFilter(s string) []*ACHParticipant
CityFilter filters ACHDictionary.ACHParticipant by city
func (*ACHDictionary) FinancialInstitutionSearch ¶
func (f *ACHDictionary) FinancialInstitutionSearch(s string, limit int) []*ACHParticipant
FinancialInstitutionSearch returns a FEDACH participant based on a ACHParticipant.CustomerName
func (*ACHDictionary) FinancialInstitutionSearchSingle ¶
func (f *ACHDictionary) FinancialInstitutionSearchSingle(s string) []*ACHParticipant
FinancialInstitutionSearchSingle returns FEDACH participants based on a ACHParticipant.CustomerName
func (*ACHDictionary) PostalCodeFilter ¶
func (f *ACHDictionary) PostalCodeFilter(s string) []*ACHParticipant
PostalCodeFilter filters ACHParticipant by postal code
func (*ACHDictionary) Read ¶
func (f *ACHDictionary) Read(r io.Reader) error
Read parses a single line or multiple lines of FedACHdir text
func (*ACHDictionary) RoutingNumberSearch ¶
func (f *ACHDictionary) RoutingNumberSearch(s string, limit int) ([]*ACHParticipant, error)
RoutingNumberSearch returns FEDACH participants if ACHParticipant.RoutingNumber begins with prefix string s. The first 2 digits of the routing number are required. Based on https://www.frbservices.org/EPaymentsDirectory/search.html
func (*ACHDictionary) RoutingNumberSearchSingle ¶
func (f *ACHDictionary) RoutingNumberSearchSingle(s string) *ACHParticipant
RoutingNumberSearchSingle returns a FEDACH participant based on a ACHParticipant.RoutingNumber. Routing Number validation is only that it exists in IndexParticipant. Expecting a valid 9 digit routing number.
func (*ACHDictionary) StateFilter ¶
func (f *ACHDictionary) StateFilter(s string) []*ACHParticipant
StateFilter filters ACHDictionary.ACHParticipant by state
type ACHLocation ¶
type ACHLocation struct { // Address Address string `json:"address"` // City City string `json:"city"` // State State string `json:"state"` // PostalCode PostalCode string `json:"postalCode"` // PostalCodeExtension PostalCodeExtension string `json:"postalCodeExtension"` }
ACHLocation is the institution's delivery address
type ACHParticipant ¶
type ACHParticipant struct { // RoutingNumber The institution's routing number RoutingNumber string `json:"routingNumber"` // OfficeCode Main/Head Office or Branch. O=main B=branch OfficeCode string `json:"officeCode"` // ServicingFRBNumber Servicing Fed's main office routing number ServicingFRBNumber string `json:"servicingFRBNumber"` // RecordTypeCode The code indicating the ABA number to be used to route or send ACH items to the RDFI // 0 = Institution is a Federal Reserve Bank // 1 = Send items to customer routing number // 2 = Send items to customer using new routing number field RecordTypeCode string `json:"recordTypeCode"` // Revised Date of last revision: YYYYMMDD, or blank Revised string `json:"revised"` // NewRoutingNumber Institution's new routing number resulting from a merger or renumber NewRoutingNumber string `json:"newRoutingNumber"` // CustomerName (36): FEDERAL RESERVE BANK CustomerName string `json:"customerName"` // Location is the delivery address ACHLocation `json:"achLocation"` // PhoneNumber The institution's phone number PhoneNumber string `json:"phoneNumber"` // StatusCode Code is based on the customers receiver code // 1 = Receives Gov/Comm StatusCode string `json:"statusCode"` // ViewCode is current view // 1 = Current view ViewCode string `json:"viewCode"` // CleanName is our cleaned up value of CustomerName CleanName string `json:"cleanName"` // Logo from third-party provider (if enabled) Logo *logos.Logo `json:"logo"` }
ACHParticipant holds a FedACH dir routing record as defined by Fed ACH Format https://www.frbservices.org/EPaymentsDirectory/achFormat.html
func (*ACHParticipant) CustomerNameLabel ¶
func (p *ACHParticipant) CustomerNameLabel() string
CustomerNameLabel returns a formatted string Title for displaying ACHParticipant.CustomerName
type RecordWrongLengthErr ¶
RecordWrongLengthErr is the error given when a record is the wrong length
func NewRecordWrongLengthErr ¶
func NewRecordWrongLengthErr(lengthRequired int, length int) RecordWrongLengthErr
NewRecordWrongLengthErr creates a new error of the RecordWrongLengthErr type
func (RecordWrongLengthErr) Error ¶
func (e RecordWrongLengthErr) Error() string
type WIREDictionary ¶
type WIREDictionary struct { // Participants is a list of Participant structs WIREParticipants []*WIREParticipant // IndexWIRERoutingNumber creates an index of WIREParticipants keyed by WIREParticipant.RoutingNumber IndexWIRERoutingNumber map[string]*WIREParticipant // IndexWIRECustomerName creates an index of WIREParticipants keyed by WIREParticipant.CustomerName IndexWIRECustomerName map[string][]*WIREParticipant // contains filtered or unexported fields }
WIREDictionary of Participant records
func NewWIREDictionary ¶
func NewWIREDictionary() *WIREDictionary
NewWIREDictionary creates a WIREDictionary
func (*WIREDictionary) CityFilter ¶
func (f *WIREDictionary) CityFilter(s string) []*WIREParticipant
CityFilter filters WIREDictionary.WIREParticipant by city
func (*WIREDictionary) FinancialInstitutionSearch ¶
func (f *WIREDictionary) FinancialInstitutionSearch(s string, limit int) []*WIREParticipant
FinancialInstitutionSearch returns a FEDWIRE participant based on a WIREParticipant.CustomerName
func (*WIREDictionary) FinancialInstitutionSearchSingle ¶
func (f *WIREDictionary) FinancialInstitutionSearchSingle(s string) []*WIREParticipant
FinancialInstitutionSearchSingle returns a FEDWIRE participant based on a WIREParticipant.CustomerName
func (*WIREDictionary) Read ¶
func (f *WIREDictionary) Read(r io.Reader) error
Read parses a single line or multiple lines of FedWIREdir text
func (*WIREDictionary) RoutingNumberSearch ¶
func (f *WIREDictionary) RoutingNumberSearch(s string, limit int) ([]*WIREParticipant, error)
RoutingNumberSearch returns FEDWIRE participants if WIREParticipant.RoutingNumber begins with prefix string s. The first 2 digits of the routing number are required. Based on https://www.frbservices.org/EPaymentsDirectory/search.html
func (*WIREDictionary) RoutingNumberSearchSingle ¶
func (f *WIREDictionary) RoutingNumberSearchSingle(s string) *WIREParticipant
RoutingNumberSearchSingle returns a FEDWIRE participant based on a WIREParticipant.RoutingNumber. Routing Number validation is only that it exists in IndexParticipant. Expecting 9 digits, checksum needs to be included.
func (*WIREDictionary) StateFilter ¶
func (f *WIREDictionary) StateFilter(s string) []*WIREParticipant
StateFilter filters WIREDictionary.WIREParticipant by state
func (*WIREDictionary) WIREParticipantCityFilter ¶
func (f *WIREDictionary) WIREParticipantCityFilter(wireParticipants []*WIREParticipant, s string) []*WIREParticipant
WIREParticipantCityFilter filters WIREParticipant by City
func (*WIREDictionary) WIREParticipantRoutingNumberFilter ¶
func (f *WIREDictionary) WIREParticipantRoutingNumberFilter(wireParticipants []*WIREParticipant, s string) ([]*WIREParticipant, error)
WIREParticipantRoutingNumberFilter filters WIREParticipant by Routing Number
func (*WIREDictionary) WIREParticipantStateFilter ¶
func (f *WIREDictionary) WIREParticipantStateFilter(wireParticipants []*WIREParticipant, s string) []*WIREParticipant
WIREParticipantStateFilter filters WIREParticipant by State.
type WIRELocation ¶
WIRELocation is the city and state
type WIREParticipant ¶
type WIREParticipant struct { // RoutingNumber The institution's routing number RoutingNumber string `json:"routingNumber"` // TelegraphicName is the short name of financial institution Wells Fargo TelegraphicName string `json:"telegraphicName"` // CustomerName (36): FEDERAL RESERVE BANK CustomerName string `json:"customerName"` // Location is the city and state WIRELocation `json:"wireLocation"` // FundsTransferStatus designates funds transfer status // Y - Eligible // N - Ineligible FundsTransferStatus string `json:"fundsTransferStatus"` // FundsSettlementOnlyStatus designates funds settlement only status // S - Settlement-Only FundsSettlementOnlyStatus string `json:"fundsSettlementOnlyStatus"` // BookEntrySecuritiesTransferStatus designates book entry securities transfer status BookEntrySecuritiesTransferStatus string `json:"bookEntrySecuritiesTransferStatus"` // Date of last revision: YYYYMMDD, or blank Date string `json:"date"` // CleanName is our cleaned up value of CustomerName CleanName string `json:"cleanName"` // Logo from third-party provider (if enabled) Logo *logos.Logo `json:"logo"` }
WIREParticipant holds a FedWIRE dir routing record as defined by Fed WIRE Format https://frbservices.org/EPaymentsDirectory/fedwireFormat.html