This Go package allows you to Marshal or Unmarshal from/to FedACH Participant RDFIs With Commercial Receipt Volume.
You can rely on this package to have the latest official version of the Fed file.
go get -u github.com/thylong/fedach
package main
import (
"fmt"
"github.com/thylong/fedach"
)
func main() {
current := fedach.GetCurrentDirectoryFile()
fmt.Printf("%#v\n", current)
}
package main
import (
"fmt"
"github.com/thylong/fedach"
)
func main() {
fileContent, err := ioutil.ReadFile("sample/FedACHdir.txt")
if err != nil {
panic(err)
}
var routingDirectoryFile []fedach.RoutingDirectoryRecord
if err := fedach.Unmarshal(fileContent, &routingDirectoryFile); err != nil {
panic(err)
}
fmt.Printf("%#v\n", routingDirectoryFile)
}
package main
import (
"fmt"
"github.com/thylong/fedach"
)
func main() {
routingDirectoryFile := []fedach.RoutingDirectoryRecord{
{
"011000015",
"O",
"011000015",
"0",
"122415",
"000000000",
"FEDERAL RESERVE BANK ",
"1000 PEACHTREE ST N.E. ",
"ATLANTA ",
"GA",
"30309",
"4470",
"877",
"372",
"2457",
"1",
"1",
" ",
},
}
encoded, err := fedach.Marshal(routingDirectoryFile)
if err != nil {
panic(err)
}
fmt.Printf("%s\n", encoded)
}
package main
import (
"fmt"
"github.com/thylong/fedach"
)
func main() {
routingDirectoryFile := [][]string{
{
"011000015",
"O",
"011000015",
"0",
"122415",
"000000000",
"FEDERAL RESERVE BANK ",
"1000 PEACHTREE ST N.E. ",
"ATLANTA ",
"GA",
"30309",
"4470",
"877",
"372",
"2457",
"1",
"1",
" ",
},
}
encoded, err := fedach.Marshal(routingDirectoryFile)
if err != nil {
panic(err)
}
fmt.Printf("%s\n", encoded)
}
Please make sure you read the frbservices agreement: https://www.frbservices.org/EPaymentsDirectory/agreement.html