update for advEntryDetail.TransactionCode
package main
import (
+ "github.com/moov-io/ach"
"log"
"os"
"time"
-
- "github.com/moov-io/ach"
- "github.com/moov-io/base"
)
func main() {
@@ -16,7 +14,7 @@ func main() {
fh := ach.NewFileHeader()
fh.ImmediateDestination = "231380104" // Routing Number of the ACH Operator or receiving point to which the file is being sent
fh.ImmediateOrigin = "121042882" // Routing Number of the ACH Operator or sending point that is sending the file
- fh.FileCreationDate = base.NewTime(time.Now()) // Today's Date
+ fh.FileCreationDate = time.Now() // Today's Date
fh.ImmediateDestinationName = "Federal Reserve Bank"
fh.ImmediateOriginName = "My Bank Name"
@@ -27,14 +25,14 @@ func main() {
bh.CompanyIdentification = fh.ImmediateOrigin
bh.StandardEntryClassCode = ach.ADV
bh.CompanyEntryDescription = "Accounting" // will be on receiving accounts statement
- bh.EffectiveEntryDate = base.NewTime(time.Now().AddDate(0, 0, 1))
+ bh.EffectiveEntryDate = time.Now().AddDate(0, 0, 1)
bh.ODFIIdentification = "121042882" // Originating Routing Number
// Identifies the receivers account information
// can be multiple entry's per batch
entry := ach.NewADVEntryDetail()
// Credit for ACH debits originated
- entry.TransactionCode = 81 //
+ entry.TransactionCode = ach.CreditForDebitsOriginated //
entry.SetRDFI("231380104") // Receivers bank transit routing number
entry.DFIAccountNumber = "744-5678-99"
entry.Amount = 50000
@@ -50,7 +48,7 @@ func main() {
entryOne := ach.NewADVEntryDetail()
// Debit for ACH credits originated
- entryOne.TransactionCode = 82 //
+ entryOne.TransactionCode = ach.DebitForCreditsOriginated //
entryOne.SetRDFI("231380104") // Receivers bank transit routing number
entryOne.DFIAccountNumber = "744-5678-99"
entryOne.Amount = 250000
