ach: github.com/moov-io/ach Index | Files | Directories

package ach

import "github.com/moov-io/ach"

Package ach reads and writes Automated Clearing House (ACH) files. ACH is the primary method of electronic money movement through the United States.

https://en.wikipedia.org/wiki/Automated_Clearing_House

https://github.com/moov-io/ach/tree/master/documentation

Read an ACH File

fd, err := os.Open("name-of-your-ach-file.ach")
if err != nil {
    log.Fatalf("problem opening file: %v", err)
}
file, err := ach.NewReader(fd).Read()
if err != nil {
    log.Fatalf("problem parsing ACH file: %v", err)
}
if err := file.Validate(); err != nil {
    log.Fatalf("ACH file isn't valid: %v", err)
}

Index

Package Files

addenda02.go addenda05.go addenda10.go addenda11.go addenda12.go addenda13.go addenda14.go addenda15.go addenda16.go addenda17.go addenda18.go addenda98.go addenda99.go advBatchControl.go advEntryDetail.go advFileControl.go batch.go batchACK.go batchADV.go batchARC.go batchATX.go batchBOC.go batchCCD.go batchCIE.go batchCOR.go batchCTX.go batchControl.go batchDNE.go batchENR.go batchErrors.go batchHeader.go batchMTE.go batchPOP.go batchPOS.go batchPPD.go batchRCK.go batchSHR.go batchTEL.go batchTRC.go batchTRX.go batchWeb.go batchXCK.go batcher.go converters.go doc.go entryDetail.go fieldErrors.go file.go fileControl.go fileErrors.go fileHeader.go iatBatch.go iatBatchHeader.go iatEntryDetail.go merge.go reader.go segmentFileConfiguration.go validators.go version.go writer.go

Constants

const (

    // CreditForDebitsOriginated is an accounting entry credit for ACH debits originated
    CreditForDebitsOriginated = 81
    // CreditForCreditsReceived is an accounting entry credits for ACH credits received
    CreditForCreditsReceived = 83
    // CreditForCreditsRejected is an accounting entry credit for ACH credits in rejected batches
    CreditForCreditsRejected = 85
    // CreditSummary is an accounting entry for summary credit for respondent ACH activity
    CreditSummary = 87

    // DebitForCreditsOriginated is an accounting entry debit for ACH credits originated
    DebitForCreditsOriginated = 82
    // DebitForDebitsReceived is an accounting entry debit for for ACH debits received
    DebitForDebitsReceived = 84
    // DebitForDebitsRejectedBatches is an accounting entry debit for ACH debits in rejected batches
    DebitForDebitsRejectedBatches = 86
    // DebitSummary is an accounting entry for summary debit for respondent ACH activity
    DebitSummary = 88
)
const (
    // ACK ACH Payment Acknowledgment - A code that indicates acknowledgment of receipt of a corporate credit payment
    // (CCD).
    ACK = "ACK"
    // ADV Automated Accounting Advice – A code that provide accounting information regarding an Entry. It is an
    // optional service.
    ADV = "ADV"
    // ARC Accounts Receivable Entry – A code that indicates a consumer check converted to a one-time ACH debit.
    // The Accounts Receivable (ARC) Entry provides initiates a single-entry ACH debit to customer accounts by
    // converting checks at the point of receipt through the U.S. mail, at a drop box location or in-person for
    // payment of a bill at a manned location.
    ARC = "ARC"
    // ATX Financial EDI Acknowledgment -  A code that indicates acknowledgement by the Receiving Depository Financial
    // Institution (RDFI) that a Corporate Credit Exchange (CTX) has been received.
    ATX = "ATX"
    // BOC Back Office Conversion Entry - A code that indicates single entry debit initiated at the point of purchase
    // or at a manned bill payment location to transfer funds through conversion to an ACH debit entry during back
    // office processing.
    BOC = "BOC"
    // CCD Corporate Credit or Debit Entry - A code that indicates an entry initiated by an Organization to transfer
    // funds to or from an account of that Organization or another Organization. For commercial accounts only.
    CCD = "CCD"
    // CIE Customer Initiated Entry - A code that indicates a credit entry initiated on behalf of, and upon the
    // instruction of, a consumer to transfer funds to a non-consumer Receiver.
    CIE = "CIE"
    // COR Notification of Change or Refused Notification of Change - A code used by an RDFI or ODFI when originating a
    // Notification of Change or Refused Notification of Change in automated format.
    COR = "COR"
    // CTX Corporate Trade Exchange - A code that indicates the ability to collect and disburse funds and information
    // between companies. Generally it is used by businesses paying one another for goods or services.
    CTX = "CTX"
    // DNE Death Notification Entry - A code that United States Federal agencies (e.g. Social Security) use to notify
    // depository financial institutions that the recipient of government benefit payments has died.
    DNE = "DNE"
    // ENR Automated Enrollment Entry - A code indicating enrollment of a person with an agency of the US government
    // for a depository financial institution.
    ENR = "ENR"
    // IAT International ACH Transaction - A code IAT indicating a  credit or debit ACH entry that is part of a payment
    // transaction involving a financial agency’s office (i.e., depository financial institution or business issuing
    // money orders) that is not located in the territorial jurisdiction of the United States. IAT entries can be made
    // to or from a corporate or consumer account and must be accompanied by seven (7) mandatory addenda records
    // identifying the name and physical address of the Originator, name and physical address of the Receiver,
    // Receiver’s account number, Receiver’s bank identity and reason for the payment.
    IAT = "IAT"
    // MTE Machine Transfer Entry - A code that indicates when a consumer uses their debit card at an Automated Teller
    // Machine (ATM) to withdraw cash.  MTE transactions cannot be aggregated together under a single Entry.
    MTE = "MTE"
    // POP Point of Purchase Entry - A code that indicates a check presented in-person to a merchant for purchase
    // is presented as an ACH entry instead of a physical check.
    POP = "POP"
    // POS Point of Sale Entry - A code that indicates a debit entry initiated at an “electronic terminal” to a
    // consumer account of the receiver to pay an obligation incurred in a point-of-sale transaction, or to effect a
    // point-of-sale terminal cash withdrawal.
    POS = "POS"
    // PPD Prearranged Payment and Deposit Entry - A code tha indicates a an entry initiated by an organization based
    // on a standing or a single entry authorization to transfer funds.
    PPD = "PPD"
    // RCK Re-presented Check Entry - A code that indicates a physical check that was presented but returned because of
    //// insufficient funds may be represented as an ACH entry.
    RCK = "RCK"
    // SHR Shared Network Transaction - A code that indicates a debit Entry initiated at an “electronic terminal,” as
    // that term is defined in Regulation E, to a Consumer Account of the Receiver to pay an obligation incurred in a
    // point-of-sale transaction, or to effect a point-of-sale terminal cash withdrawal. Also an adjusting or other
    // credit Entry related to such debit Entry, transfer of funds, or obligation. SHR Entries are initiated in a
    // shared network where the ODFI and RDFI have an agreement in addition to these Rules to process such Entries.
    SHR = "SHR"
    // TEL Telephone Initiated Entry - A code indicating a Telephone-Initiated consumer debit transactions. The NACHA
    // Operating Rules permit TEL entries when the originator obtains the Receiver’s authorization for the debit entry
    // orally via the telephone.  An entry based upon a Receiver’s oral authorization must utilize the TEL
    // Standard Entry Class (SEC) Code.
    TEL = "TEL"
    // TRC Check Truncation Entry - is a code used to identify a debit entry of a truncated check.
    TRC = "TRC"
    // TRX Check Truncation Entries Exchange - used to identify a debit entry exchange of a truncated checks (multiple).
    TRX = "TRX"
    // WEB Internet-Initiated/Mobile Entry - A code indicating an entry submitted pursuant to an authorization obtained
    // solely via the Internet or a mobile network. For consumer accounts only.
    WEB = "WEB"
    // XCK Destroyed Check Entry - A code indicating a debit entry initiated for a a destroyed check eligible items
    XCK = "XCK"
)
const (

    // MixedDebitsAndCredits indicates a batch can have debit and credit ACH entries
    MixedDebitsAndCredits = 200
    // CreditsOnly indicates a batch can only have credit ACH entries
    CreditsOnly = 220
    // DebitsOnly indicates a batch can only have debit ACH entries
    DebitsOnly = 225
    // AutomatedAccountingAdvices indicates a batch can only have Automated Accounting Advices (debit and credit)
    AutomatedAccountingAdvices = 280
)
const (
    // CategoryForward defines the entry as being sent to the receiving institution
    CategoryForward = "Forward"
    // CategoryReturn defines the entry as being a return of a forward entry back to the originating institution
    CategoryReturn = "Return"
    // CategoryNOC defines the entry as being a notification of change of a forward entry to the originating institution
    CategoryNOC = "NOC"
    // CategoryDishonoredReturn defines the entry as being a dishonored return initiated by the ODFI to the RDFI that
    // submitted the return entry
    CategoryDishonoredReturn = "DishonoredReturn"
    // CategoryDishonoredReturnContested defines the entry as a contested dishonored return initiated by the RDFI to
    // the ODFI that submitted the dishonored return
    CategoryDishonoredReturnContested = "DishonoredReturnContested"

    // CheckingCredit is a credit to the receiver's checking account
    CheckingCredit = 22
    // CheckingReturnNOCCredit is a return that credits the receiver's checking account
    CheckingReturnNOCCredit = 21
    // CheckingPrenoteCredit is a pre-notification of a credit to the receiver's checking account
    CheckingPrenoteCredit = 23
    // CheckingZeroDollarRemittanceCredit is a zero dollar remittance data credit to a checking account for CCD, CTX,
    // ACK, and ATX entries
    CheckingZeroDollarRemittanceCredit = 24
    // CheckingDebit is a debit to the receivers checking account
    CheckingDebit = 27
    // CheckingReturnNOCDebit is a return that debits the receiver's checking account
    CheckingReturnNOCDebit = 26
    // CheckingPrenoteDebit is a pre-notification of a debit to the receiver's checking account
    CheckingPrenoteDebit = 28
    // CheckingZeroDollarRemittanceDebit is a zero dollar remittance data debit to a checking account for CCD, CTX,
    // ACK, and ATX entries
    CheckingZeroDollarRemittanceDebit = 29

    // SavingsCredit is a credit to the receiver's savings account
    SavingsCredit = 32
    // SavingsReturnNOCCredit is a return that credits the receiver's savings account
    SavingsReturnNOCCredit = 31
    // SavingsPrenoteCredit is a pre-notification of a credit to the receiver's savings account
    SavingsPrenoteCredit = 33
    // SavingsZeroDollarRemittanceCredit is a zero dollar remittance data credit to a savings account for CCD
    // and CTX entries
    SavingsZeroDollarRemittanceCredit = 34
    // SavingsDebit is a debit to the receivers savings account
    SavingsDebit = 37
    // SavingsReturnNOCDebit is a return that debits the receiver's savings account
    SavingsReturnNOCDebit = 36
    // SavingsPrenoteDebit is a pre-notification of a debit to the receiver's savings account
    SavingsPrenoteDebit = 38
    // SavingsZeroDollarRemittanceDebit is a zero dollar remittance data debit to a savings account for CCD
    // and CTX entries
    SavingsZeroDollarRemittanceDebit = 39

    // GLCredit is a credit to the receiver's general ledger (GL) account
    GLCredit = 42
    // GLReturnNOCCredit is a return that credits the receiver's general ledger (GL) account
    GLReturnNOCCredit = 41
    // GLPrenoteCredit is a pre-notification of a credit to the receiver's general ledger (GL) account
    GLPrenoteCredit = 43
    // GLZeroDollarRemittanceCredit is a zero dollar remittance data credit to the receiver's general ledger (GL) account
    GLZeroDollarRemittanceCredit = 44
    // GLDebit is a debit to the receiver's general ledger (GL) account
    GLDebit = 47
    // GLReturnNOCDebit is a return that debits the receiver's general ledger (GL) account
    GLReturnNOCDebit = 46
    // GLPrenoteDebit is a pre-notification of a debit to the receiver's general ledger (GL) account
    GLPrenoteDebit = 48
    // GLZeroDollarRemittanceDebit is a zero dollar remittance data debit to the receiver's general ledger (GL) account
    GLZeroDollarRemittanceDebit = 49

    // LoanCredit is a credit to the receiver's loan account
    LoanCredit = 52
    // LoanReturnNOCCredit is a return that credits the receiver's loan account
    LoanReturnNOCCredit = 51
    // LoanPrenoteCredit is a pre-notification of a credit to the receiver's loan account
    LoanPrenoteCredit = 53
    // LoanZeroDollarRemittanceCredit is a zero dollar remittance data credit to the receiver's loan account
    LoanZeroDollarRemittanceCredit = 54
    // LoanDebit is a debit (Reversal's Only) to the receiver's loan account
    LoanDebit = 55
    // LoanReturnNOCDebit is a return that debits the receiver's loan account
    LoanReturnNOCDebit = 56
)
const (
    // IATCOR is the valid value for IATBatchHeader.IATIndicator for IAT Notification Of Changr
    IATCOR = "IATCOR"
)
const NACHAFileLineLimit = 10000
const (

    // RecordLength character count of each line representing a letter in a file
    RecordLength = 94
)

First position of all Record Types. These codes are uniquely assigned to the first byte of each row in a file.

const Version = "v1.2.0-dev"

Version Number

Variables

var (
    // ErrBatchNoEntries is the error given when a batch doesn't have any entries
    ErrBatchNoEntries = errors.New("must have Entry Record(s) to be built")
    // ErrBatchADVCount is the error given when an ADV batch has too many entries
    ErrBatchADVCount = errors.New("there can be a maximum of 9999 ADV Sequence Numbers (ADV Entry Detail Records)")
    // ErrBatchAddendaIndicator is the error given when the addenda indicator is incorrectly set
    ErrBatchAddendaIndicator = errors.New("is 0 but found addenda record(s)")
    // ErrBatchOriginatorDNE is the error given when a non-government agency tries to originate a DNE
    ErrBatchOriginatorDNE = errors.New("only government agencies (originator status code 2) can originate a DNE")
    // ErrBatchInvalidCardTransactionType is the error given when a card transaction type is invalid
    ErrBatchInvalidCardTransactionType = errors.New("invalid card transaction type")
    // ErrBatchDebitOnly is the error given when a batch which can only have debits has a credit
    ErrBatchDebitOnly = errors.New("this batch type does not allow credit transaction codes")
    // ErrBatchCheckSerialNumber is the error given when a batch requires check serial numbers, but it is missing
    ErrBatchCheckSerialNumber = errors.New("this batch type requires entries to have Check Serial Numbers")
    // ErrBatchSECType is the error given when the batch's header has the wrong SEC for its type
    ErrBatchSECType = errors.New("header SEC does not match this batch's type")
    // ErrBatchServiceClassCode is the error given when the batch's header has the wrong SCC for its type
    ErrBatchServiceClassCode = errors.New("header SCC is not valid for this batch's type")
    // ErrBatchTransactionCode is the error given when a batch has an invalid transaction code
    ErrBatchTransactionCode = errors.New("transaction code is not valid for this batch's type")
    // ErrBatchTransactionCodeAddenda is the error given when a batch has an addenda on a transaction code which doesn't allow it
    ErrBatchTransactionCodeAddenda = errors.New("this batch type does not allow an addenda for this transaction code")
    // ErrBatchAmountNonZero is the error given when an entry for a non-zero amount is in a batch that requires zero amount entries
    ErrBatchAmountNonZero = errors.New("this batch type requires that the amount is zero")
    // ErrBatchAmountZero is the error given when an entry for zero amount is in a batch that requires non-zero amount entries
    ErrBatchAmountZero = errors.New("this batch type requires that the amount is non-zero")
    // ErrBatchCompanyEntryDescriptionAutoenroll is the error given when the Company Entry Description is invalid (needs to be 'Autoenroll')
    ErrBatchCompanyEntryDescriptionAutoenroll = errors.New("this batch type requires that the Company Entry Description is AUTOENROLL")
    // ErrBatchCompanyEntryDescriptionREDEPCHECK is the error given when the Company Entry Description is invalid (needs to be 'REDEPCHECK')
    ErrBatchCompanyEntryDescriptionREDEPCHECK = errors.New("this batch type requires that the Company Entry Description is REDEPCHECK")
    // ErrBatchAddendaCategory is the error given when the addenda isn't allowed for the batch's type and category
    ErrBatchAddendaCategory = errors.New("this batch type does not allow this addenda for category")
)
var (

    //ErrNonAlphanumeric is given when a field has non-alphanumeric characters
    ErrNonAlphanumeric = errors.New("has non alphanumeric characters")
    //ErrUpperAlpha is given when a field is not in uppercase
    ErrUpperAlpha = errors.New("is not uppercase A-Z or 0-9")
    //ErrFieldInclusion is given when a field is mandatory and has a default value
    ErrFieldInclusion = errors.New("is a mandatory field and has a default value")
    //ErrConstructor is given when there's a mandatory field is not initialized correctly, and prompts to use the constructor
    ErrConstructor = errors.New("is a mandatory field and has a default value, did you use the constructor?")
    //ErrFieldRequired is given when a field is required
    ErrFieldRequired = errors.New("is a required field")
    //ErrServiceClass is given when there's an invalid service class code
    ErrServiceClass = errors.New("is an invalid Service Class Code")
    //ErrSECCode is given when there's an invalid standard entry class code
    ErrSECCode = errors.New("is an invalid Standard Entry Class Code")
    //ErrOrigStatusCode is given when there's an invalid originator status code
    ErrOrigStatusCode = errors.New("is an invalid Originator Status Code")
    //ErrAddendaTypeCode is given when there's an invalid addenda type code
    ErrAddendaTypeCode = errors.New("is an invalid Addenda Type Code")
    //ErrTransactionCode is given when there's an invalid transaction code
    ErrTransactionCode = errors.New("is an invalid Transaction Code")
    //ErrIdentificationNumber is given when there's an invalid identification number
    ErrIdentificationNumber = errors.New("is an invalid identification number")
    //ErrCardTransactionType  is given when there's an invalid card transaction type
    ErrCardTransactionType = errors.New("is an invalid Card Transaction Type")
    //ErrValidMonth is given when there's an invalid month
    ErrValidMonth = errors.New("is an invalid month")
    //ErrValidDay is given when there's an invalid day
    ErrValidDay = errors.New("is an invalid day")
    //ErrValidYear is given when there's an invalid year
    ErrValidYear = errors.New("is an invalid year")
    // ErrValidState is the error given when a field has an invalid US state or territory
    ErrValidState = errors.New("is an invalid US state or territory")
    // ErrValidISO3166 is the error given when a field has an invalid ISO 3166-1-alpha-2 code
    ErrValidISO3166 = errors.New("is an invalid ISO 3166-1-alpha-2 code")
    // ErrValidISO4217 is the error given when a field has an invalid ISO 4217 code
    ErrValidISO4217 = errors.New("is an invalid ISO 4217 code")

    // ErrNegativeAmount is the error given when an Amount value is negaitve, which is
    // against NACHA rules and guidelines.
    ErrNegativeAmount = errors.New("amounts cannot be negative")

    // ErrAddenda98ChangeCode is given when there's an invalid addenda change code
    ErrAddenda98ChangeCode = errors.New("found is not a valid addenda Change Code")
    // ErrAddenda98CorrectedData is given when the corrected data does not corespond to the change code
    ErrAddenda98CorrectedData = errors.New("must contain the corrected information corresponding to the Change Code")
    // ErrAddenda99ReturnCode is given when there's an invalid return code
    ErrAddenda99ReturnCode = errors.New("found is not a valid return code")
    // ErrBatchCORAddenda is given when an entry in a COR batch does not have an addenda98
    ErrBatchCORAddenda = errors.New("one Addenda98 record is required for each entry in SEC Type COR")

    // ErrRecordSize is given when there's an invalid record size
    ErrRecordSize = errors.New("is not 094")
    // ErrBlockingFactor is given when there's an invalid blocking factor
    ErrBlockingFactor = errors.New("is not 10")
    // ErrFormatCode is given when there's an invalid format code
    ErrFormatCode = errors.New("is not 1")

    // ErrForeignExchangeIndicator is given when there's an invalid foreign exchange indicator
    ErrForeignExchangeIndicator = errors.New("is an invalid Foreign Exchange Indicator")
    // ErrForeignExchangeReferenceIndicator is given when there's an invalid foreign exchange reference indicator
    ErrForeignExchangeReferenceIndicator = errors.New("is an invalid Foreign Exchange Reference Indicator")
    // ErrTransactionTypeCode is given when there's an invalid transaction type code
    ErrTransactionTypeCode = errors.New("is an invalid Addenda10 Transaction Type Code")
    // ErrIDNumberQualifier is given when there's an invalid identification number qualifier
    ErrIDNumberQualifier = errors.New("is an invalid Identification Number Qualifier")
    // ErrIATBatchAddendaIndicator is given when there's an invalid addenda record for an IAT batch
    ErrIATBatchAddendaIndicator = errors.New("is invalid for addenda record(s) found")
)
var (
    // ErrFileTooLong is the error given when a file exceeds the maximum possible length
    ErrFileTooLong = errors.New("file exceeds maximum possible number of lines")
    // ErrFileHeader is the error given if there is the wrong number of file headers
    ErrFileHeader = errors.New("none or more than one file headers exists")
    // ErrFileControl is the error given if there is the wrong number of file control records
    ErrFileControl = errors.New("none or more than one file control exists")
    // ErrFileEntryOutsideBatch is the error given if an entry is outside of a batch
    ErrFileEntryOutsideBatch = errors.New("entry outside of batch")
    // ErrFileAddendaOutsideBatch is the error given if an addenda is outside of a batch
    ErrFileAddendaOutsideBatch = errors.New("addenda outside of batch")
    // ErrFileAddendaOutsideEntry is the error given if an addenda is outside of an entry
    ErrFileAddendaOutsideEntry = errors.New("addenda outside of entry")
    // ErrFileBatchControlOutsideBatch is the error given if a batch control record is outside of a batch
    ErrFileBatchControlOutsideBatch = errors.New("batch control outside of batch")
    // ErrFileBatchHeaderInsideBatch is the error given if a batch header record is inside of a batch
    ErrFileBatchHeaderInsideBatch = errors.New("batch header inside of batch")
    // ErrFileADVOnly is the error given if an ADV only file has a non-ADV batch
    ErrFileADVOnly = errors.New("file can only have ADV Batches")
    // ErrFileIATSEC is the error given if an IAT batch uses the normal NewBatch
    ErrFileIATSEC = errors.New("IAT Standard Entry Class Code should use iatBatch")
    // ErrFileNoBatches is the error given if a file has no batches
    ErrFileNoBatches = errors.New("must have []*Batches or []*IATBatches to be built")
)

func CheckRoutingNumber Uses

func CheckRoutingNumber(routingNumber string) error

CheckRoutingNumber returns a nil error if the provided routingNumber is valid according to NACHA rules. See CalculateCheckDigit for details on computing the check digit.

type ADVBatchControl Uses

type ADVBatchControl struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // This should be the same as BatchHeader ServiceClassCode for ADV: AutomatedAccountingAdvices.
    ServiceClassCode int `json:"serviceClassCode"`
    // EntryAddendaCount is a tally of each Entry Detail Record and each Addenda
    // Record processed, within either the batch or file as appropriate.
    EntryAddendaCount int `json:"entryAddendaÇount"`
    // validate the Receiving DFI Identification in each Entry Detail Record is hashed
    // to provide a check against inadvertent alteration of data contents due
    // to hardware failure or program error
    //
    // In this context the Entry Hash is the sum of the corresponding fields in the
    // Entry Detail Records on the file.
    EntryHash int `json:"entryHash"`
    // TotalDebitEntryDollarAmount Contains accumulated Entry debit totals within the batch.
    TotalDebitEntryDollarAmount int `json:"totalDebit"`
    // TotalCreditEntryDollarAmount Contains accumulated Entry credit totals within the batch.
    TotalCreditEntryDollarAmount int `json:"totalCredit"`
    // ACHOperatorData is an alphanumeric code used to identify an ACH Operator
    ACHOperatorData string `json:"achOperatorData"`
    // ODFIIdentification the routing number is used to identify the DFI originating entries within a given branch.
    ODFIIdentification string `json:"ODFIIdentification"`
    // BatchNumber this number is assigned in ascending sequence to each batch by the ODFI
    // or its Sending Point in a given file of entries. Since the batch number
    // in the Batch Header Record and the Batch Control Record is the same,
    // the ascending sequence number should be assigned by batch and not by record.
    BatchNumber int `json:"batchNumber"`
    // contains filtered or unexported fields
}

ADVBatchControl contains entry counts, dollar total and has totals for all entries contained in the preceding batch

func NewADVBatchControl Uses

func NewADVBatchControl() *ADVBatchControl

NewADVBatchControl returns a new ADVBatchControl with default values for none exported fields

func (*ADVBatchControl) ACHOperatorDataField Uses

func (bc *ADVBatchControl) ACHOperatorDataField() string

ACHOperatorDataField get the ACHOperatorData right padded

func (*ADVBatchControl) BatchNumberField Uses

func (bc *ADVBatchControl) BatchNumberField() string

BatchNumberField gets a string of the batch number zero padded

func (*ADVBatchControl) CalculateCheckDigit Uses

func (v *ADVBatchControl) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*ADVBatchControl) EntryAddendaCountField Uses

func (bc *ADVBatchControl) EntryAddendaCountField() string

EntryAddendaCountField gets a string of the addenda count zero padded

func (*ADVBatchControl) EntryHashField Uses

func (bc *ADVBatchControl) EntryHashField() string

EntryHashField get a zero padded EntryHash

func (*ADVBatchControl) ODFIIdentificationField Uses

func (bc *ADVBatchControl) ODFIIdentificationField() string

ODFIIdentificationField get the odfi number zero padded

func (*ADVBatchControl) Parse Uses

func (bc *ADVBatchControl) Parse(record string)

Parse takes the input record string and parses the EntryDetail values

func (*ADVBatchControl) String Uses

func (bc *ADVBatchControl) String() string

String writes the ADVBatchControl struct to a 94 character string.

func (*ADVBatchControl) TotalCreditEntryDollarAmountField Uses

func (bc *ADVBatchControl) TotalCreditEntryDollarAmountField() string

TotalCreditEntryDollarAmountField get a zero padded Credit Entry Amount

func (*ADVBatchControl) TotalDebitEntryDollarAmountField Uses

func (bc *ADVBatchControl) TotalDebitEntryDollarAmountField() string

TotalDebitEntryDollarAmountField get a zero padded Debit Entry Amount

func (*ADVBatchControl) Validate Uses

func (bc *ADVBatchControl) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type ADVEntryDetail Uses

type ADVEntryDetail struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // TransactionCode representing Accounting Entries
    // Credit for ACH debits originated - 81
    // Debit for ACH credits originated - 82
    // Credit for ACH credits received 83
    // Debit for ACH debits received 84
    // Credit for ACH credits in rejected batches 85
    // Debit for ACH debits in rejected batches - 86
    // Summary credit for respondent ACH activity - 87
    // Summary debit for respondent ACH activity - 88
    TransactionCode int `json:"transactionCode"`
    // RDFIIdentification is the RDFI's routing number without the last digit.
    // Receiving Depository Financial Institution
    RDFIIdentification string `json:"RDFIIdentification"`
    // CheckDigit the last digit of the RDFI's routing number
    CheckDigit string `json:"checkDigit"`
    // DFIAccountNumber is the receiver's bank account number you are crediting/debiting.
    // It important to note that this is an alphanumeric field, so its space padded, no zero padded
    DFIAccountNumber string `json:"DFIAccountNumber"`
    // Amount Number of cents you are debiting/crediting this account
    Amount int `json:"amount"`
    // AdviceRoutingNumber
    AdviceRoutingNumber string `json:"adviceRoutingNumber"`
    // FileIdentification
    FileIdentification string `json:"fileIdentification,omitempty"`
    // ACHOperatorData
    ACHOperatorData string `json:"achOperatorData,omitempty"`
    // IndividualName The name of the receiver, usually the name on the bank account
    IndividualName string `json:"individualName"`
    // DiscretionaryData allows ODFIs to include codes, of significance only to them,
    // to enable specialized handling of the entry. There will be no
    // standardized interpretation for the value of this field. It can either
    // be a single two-character code, or two distinct one-character codes,
    // according to the needs of the ODFI and/or Originator involved. This
    // field must be returned intact for any returned entry.
    DiscretionaryData string `json:"discretionaryData,omitempty"`
    // AddendaRecordIndicator indicates the existence of an Addenda Record.
    // A value of "1" indicates that one ore more addenda records follow,
    // and "0" means no such record is present.
    AddendaRecordIndicator int `json:"addendaRecordIndicator,omitempty"`
    // ACHOperatorRoutingNumber
    ACHOperatorRoutingNumber string `json:"achOperatorRoutingNumber"`
    // JulianDay
    JulianDay int `json:"julianDay"`
    // SequenceNumber
    SequenceNumber int `json:"sequenceNumber,omitempty"`
    // Addenda99 for use with Returns
    Addenda99 *Addenda99 `json:"addenda99,omitempty"`
    // Category defines if the entry is a Forward, Return, or NOC
    Category string `json:"category,omitempty"`
    // contains filtered or unexported fields
}

ADVEntryDetail contains the actual transaction data for an individual entry. Fields include those designating the entry as a deposit (credit) or withdrawal (debit), the transit routing number for the entry recipient’s financial institution, the account number (left justify,no zero fill), name, and dollar amount.

func NewADVEntryDetail Uses

func NewADVEntryDetail() *ADVEntryDetail

NewADVEntryDetail returns a new ADVEntryDetail with default values for non exported fields

func (*ADVEntryDetail) ACHOperatorDataField Uses

func (ed *ADVEntryDetail) ACHOperatorDataField() string

ACHOperatorDataField returns a space padded string of ACHOperatorData

func (*ADVEntryDetail) ACHOperatorRoutingNumberField Uses

func (ed *ADVEntryDetail) ACHOperatorRoutingNumberField() string

ACHOperatorRoutingNumberField returns a space padded string of ACHOperatorRoutingNumber

func (*ADVEntryDetail) AdviceRoutingNumberField Uses

func (ed *ADVEntryDetail) AdviceRoutingNumberField() string

AdviceRoutingNumberField gets the AdviceRoutingNumber with zero padding

func (*ADVEntryDetail) AmountField Uses

func (ed *ADVEntryDetail) AmountField() string

AmountField returns a zero padded string of amount

func (*ADVEntryDetail) CalculateCheckDigit Uses

func (v *ADVEntryDetail) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*ADVEntryDetail) DFIAccountNumberField Uses

func (ed *ADVEntryDetail) DFIAccountNumberField() string

DFIAccountNumberField gets the DFIAccountNumber with space padding

func (*ADVEntryDetail) DiscretionaryDataField Uses

func (ed *ADVEntryDetail) DiscretionaryDataField() string

DiscretionaryDataField returns a space padded string of DiscretionaryData

func (*ADVEntryDetail) FileIdentificationField Uses

func (ed *ADVEntryDetail) FileIdentificationField() string

FileIdentificationField returns a space padded string of FileIdentification

func (*ADVEntryDetail) IndividualNameField Uses

func (ed *ADVEntryDetail) IndividualNameField() string

IndividualNameField returns a space padded string of IndividualName

func (*ADVEntryDetail) JulianDateDayField Uses

func (ed *ADVEntryDetail) JulianDateDayField() string

JulianDateDayField returns a zero padded string of JulianDay

func (*ADVEntryDetail) Parse Uses

func (ed *ADVEntryDetail) Parse(record string)

Parse ADVEntryDetail

func (*ADVEntryDetail) RDFIIdentificationField Uses

func (ed *ADVEntryDetail) RDFIIdentificationField() string

RDFIIdentificationField get the rdfiIdentification with zero padding

func (*ADVEntryDetail) SequenceNumberField Uses

func (ed *ADVEntryDetail) SequenceNumberField() string

SequenceNumberField returns a zero padded string of SequenceNumber

func (*ADVEntryDetail) SetRDFI Uses

func (ed *ADVEntryDetail) SetRDFI(rdfi string) *ADVEntryDetail

SetRDFI takes the 9 digit RDFI account number and separates it for RDFIIdentification and CheckDigit

func (*ADVEntryDetail) String Uses

func (ed *ADVEntryDetail) String() string

String writes the ADVEntryDetail struct to a 94 character string.

func (*ADVEntryDetail) Validate Uses

func (ed *ADVEntryDetail) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type ADVFileControl Uses

type ADVFileControl struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // BatchCount total number of batches (i.e., ‘5’ records) in the file
    BatchCount int `json:"batchCount"`

    // BlockCount total number of records in the file (include all headers and trailer) divided
    // by 10 (This number must be evenly divisible by 10. If not, additional records consisting of all 9’s are added to the file after the initial ‘9’ record to fill out the block 10.)
    BlockCount int `json:"blockCount,omitempty"`

    // EntryAddendaCount total detail and addenda records in the file
    EntryAddendaCount int `json:"entryAddendaCount"`

    // EntryHash calculated in the same manner as the batch has total but includes total from entire file
    EntryHash int `json:"entryHash"`

    // TotalDebitEntryDollarAmountInFile contains accumulated Batch debit totals within the file.
    TotalDebitEntryDollarAmountInFile int `json:"totalDebit"`

    // TotalCreditEntryDollarAmountInFile contains accumulated Batch credit totals within the file.
    TotalCreditEntryDollarAmountInFile int `json:"totalCredit"`
    // contains filtered or unexported fields
}

ADVFileControl record contains entry counts, dollar totals and hash totals accumulated from each batchADV control record in the file.

func NewADVFileControl Uses

func NewADVFileControl() ADVFileControl

NewADVFileControl returns a new ADVFileControl with default values for none exported fields

func (*ADVFileControl) BatchCountField Uses

func (fc *ADVFileControl) BatchCountField() string

BatchCountField gets a string of the batch count zero padded

func (*ADVFileControl) BlockCountField Uses

func (fc *ADVFileControl) BlockCountField() string

BlockCountField gets a string of the block count zero padded

func (*ADVFileControl) CalculateCheckDigit Uses

func (v *ADVFileControl) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*ADVFileControl) EntryAddendaCountField Uses

func (fc *ADVFileControl) EntryAddendaCountField() string

EntryAddendaCountField gets a string of entry addenda batch count zero padded

func (*ADVFileControl) EntryHashField Uses

func (fc *ADVFileControl) EntryHashField() string

EntryHashField gets a string of entry hash zero padded

func (*ADVFileControl) Parse Uses

func (fc *ADVFileControl) Parse(record string)

Parse takes the input record string and parses the FileControl values Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*ADVFileControl) String Uses

func (fc *ADVFileControl) String() string

String writes the ADVFileControl struct to a 94 character string.

func (*ADVFileControl) TotalCreditEntryDollarAmountInFileField Uses

func (fc *ADVFileControl) TotalCreditEntryDollarAmountInFileField() string

TotalCreditEntryDollarAmountInFileField get a zero padded Total credit Entry Amount

func (*ADVFileControl) TotalDebitEntryDollarAmountInFileField Uses

func (fc *ADVFileControl) TotalDebitEntryDollarAmountInFileField() string

TotalDebitEntryDollarAmountInFileField get a zero padded Total debit Entry Amount

func (*ADVFileControl) Validate Uses

func (fc *ADVFileControl) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type Addenda02 Uses

type Addenda02 struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // TypeCode Addenda02 type code '02'
    TypeCode string `json:"typeCode"`
    // ReferenceInformationOne may be used for additional reference numbers, identification numbers,
    // or codes that the merchant needs to identify the particular transaction or customer.
    ReferenceInformationOne string `json:"referenceInformationOne,omitempty"`
    // ReferenceInformationTwo  may be used for additional reference numbers, identification numbers,
    // or codes that the merchant needs to identify the particular transaction or customer.
    ReferenceInformationTwo string `json:"referenceInformationTwo,omitempty"`
    // TerminalIdentificationCode identifies an Electronic terminal with a unique code that allows
    // a terminal owner and/or switching network to identify the terminal at which an Entry originated.
    TerminalIdentificationCode string `json:"terminalIdentificationCode"`
    // TransactionSerialNumber is assigned by the terminal at the time the transaction is originated.  The
    // number, with the Terminal Identification Code, serves as an audit trail for the transaction and is
    // usually assigned in ascending sequence.
    TransactionSerialNumber string `json:"transactionSerialNumber"`
    // TransactionDate expressed MMDD identifies the date on which the transaction occurred.
    TransactionDate string `json:"transactionDate"`
    // AuthorizationCodeOrExpireDate indicates the code that a card authorization center has
    // furnished to the merchant.
    AuthorizationCodeOrExpireDate string `json:"authorizationCodeOrExpireDate,omitempty"`
    // Terminal Location identifies the specific location of a terminal (i.e., street names of an
    // intersection, address, etc.) in accordance with the requirements of Regulation E.
    TerminalLocation string `json:"terminalLocation"`
    // TerminalCity Identifies the city in which the electronic terminal is located.
    TerminalCity string `json:"terminalCity"`
    // TerminalState Identifies the state in which the electronic terminal is located
    TerminalState string `json:"terminalState"`
    // TraceNumber Standard Entry Detail Trace Number
    //
    // Use TraceNumberField() for a properly formatted string representation.
    TraceNumber string `json:"traceNumber,omitempty"`
    // contains filtered or unexported fields
}

Addenda02 is a Addendumer addenda which provides business transaction information for Addenda Type Code 02 in a machine readable format. It is usually formatted according to ANSI, ASC, X12 Standard. It is used for following StandardEntryClassCode: MTE, POS, and SHR.

func NewAddenda02 Uses

func NewAddenda02() *Addenda02

NewAddenda02 returns a new Addenda02 with default values for none exported fields

func (*Addenda02) AuthorizationCodeOrExpireDateField Uses

func (addenda02 *Addenda02) AuthorizationCodeOrExpireDateField() string

AuthorizationCodeOrExpireDateField returns a space padded AuthorizationCodeOrExpireDate string

func (*Addenda02) CalculateCheckDigit Uses

func (v *Addenda02) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*Addenda02) Parse Uses

func (addenda02 *Addenda02) Parse(record string)

Parse takes the input record string and parses the Addenda02 values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*Addenda02) ReferenceInformationOneField Uses

func (addenda02 *Addenda02) ReferenceInformationOneField() string

ReferenceInformationOneField returns a space padded ReferenceInformationOne string

func (*Addenda02) ReferenceInformationTwoField Uses

func (addenda02 *Addenda02) ReferenceInformationTwoField() string

ReferenceInformationTwoField returns a space padded ReferenceInformationTwo string

func (*Addenda02) String Uses

func (addenda02 *Addenda02) String() string

String writes the Addenda02 struct to a 94 character string.

func (*Addenda02) TerminalCityField Uses

func (addenda02 *Addenda02) TerminalCityField() string

TerminalCityField returns a space padded TerminalCity string

func (*Addenda02) TerminalIdentificationCodeField Uses

func (addenda02 *Addenda02) TerminalIdentificationCodeField() string

TerminalIdentificationCodeField returns a space padded TerminalIdentificationCode string

func (*Addenda02) TerminalLocationField Uses

func (addenda02 *Addenda02) TerminalLocationField() string

TerminalLocationField returns a space padded TerminalLocation string

func (*Addenda02) TerminalStateField Uses

func (addenda02 *Addenda02) TerminalStateField() string

TerminalStateField returns a space padded TerminalState string

func (*Addenda02) TraceNumberField Uses

func (addenda02 *Addenda02) TraceNumberField() string

TraceNumberField returns a space padded TraceNumber string

func (*Addenda02) TransactionDateField Uses

func (addenda02 *Addenda02) TransactionDateField() string

TransactionDateField returns TransactionDate MMDD string

func (*Addenda02) TransactionSerialNumberField Uses

func (addenda02 *Addenda02) TransactionSerialNumberField() string

TransactionSerialNumberField returns a zero padded TransactionSerialNumber string

func (*Addenda02) Validate Uses

func (addenda02 *Addenda02) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type Addenda05 Uses

type Addenda05 struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // TypeCode Addenda05 types code '05'
    TypeCode string `json:"typeCode"`
    // PaymentRelatedInformation
    PaymentRelatedInformation string `json:"paymentRelatedInformation"`
    // SequenceNumber is consecutively assigned to each Addenda05 Record following
    // an Entry Detail Record. The first addenda05 sequence number must always
    // be a "1".
    SequenceNumber int `json:"sequenceNumber,omitempty"`
    // EntryDetailSequenceNumber contains the ascending sequence number section of the Entry
    // Detail or Corporate Entry Detail Record's trace number This number is
    // the same as the last seven digits of the trace number of the related
    // Entry Detail Record or Corporate Entry Detail Record.
    EntryDetailSequenceNumber int `json:"entryDetailSequenceNumber,omitempty"`
    // contains filtered or unexported fields
}

Addenda05 is a Addendumer addenda which provides business transaction information for Addenda Type Code 05 in a machine readable format. It is usually formatted according to ANSI, ASC, X12 Standard. It is used for the following StandardEntryClassCode: ACK, ATX, CCD, CIE, CTX, DNE, ENR, WEB, PPD, TRX.

func NewAddenda05 Uses

func NewAddenda05() *Addenda05

NewAddenda05 returns a new Addenda05 with default values for none exported fields

func (*Addenda05) CalculateCheckDigit Uses

func (v *Addenda05) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*Addenda05) EntryDetailSequenceNumberField Uses

func (addenda05 *Addenda05) EntryDetailSequenceNumberField() string

EntryDetailSequenceNumberField returns a zero padded EntryDetailSequenceNumber string

func (*Addenda05) Parse Uses

func (addenda05 *Addenda05) Parse(record string)

Parse takes the input record string and parses the Addenda05 values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*Addenda05) PaymentRelatedInformationField Uses

func (addenda05 *Addenda05) PaymentRelatedInformationField() string

PaymentRelatedInformationField returns a zero padded PaymentRelatedInformation string

func (*Addenda05) SequenceNumberField Uses

func (addenda05 *Addenda05) SequenceNumberField() string

SequenceNumberField returns a zero padded SequenceNumber string

func (*Addenda05) String Uses

func (addenda05 *Addenda05) String() string

String writes the Addenda05 struct to a 94 character string.

func (*Addenda05) Validate Uses

func (addenda05 *Addenda05) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type Addenda10 Uses

type Addenda10 struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // TypeCode Addenda10 types code '10'
    TypeCode string `json:"typeCode"`
    // Transaction Type Code Describes the type of payment:
    // ANN = Annuity, BUS = Business/Commercial, DEP = Deposit, LOA = Loan, MIS = Miscellaneous, MOR = Mortgage
    // PEN = Pension, RLS = Rent/Lease, REM = Remittance2, SAL = Salary/Payroll, TAX = Tax, TEL = Telephone-Initiated Transaction
    // WEB = Internet-Initiated Transaction, ARC = Accounts Receivable Entry, BOC = Back Office Conversion Entry,
    // POP = Point of Purchase Entry, RCK = Re-presented Check Entry
    TransactionTypeCode string `json:"transactionTypeCode"`
    // Foreign Payment Amount $$$$$$$$$$$$$$$$¢¢
    // For inbound IAT payments this field should contain the USD amount or may be blank.
    ForeignPaymentAmount int `json:"foreignPaymentAmount"`
    // Foreign Trace Number
    ForeignTraceNumber string `json:"foreignTraceNumber,omitempty"`
    // Receiving Company Name/Individual Name
    Name string `json:"name"`

    // EntryDetailSequenceNumber contains the ascending sequence number section of the Entry
    // Detail or Corporate Entry Detail Record's trace number This number is
    // the same as the last seven digits of the trace number of the related
    // Entry Detail Record or Corporate Entry Detail Record.
    EntryDetailSequenceNumber int `json:"entryDetailSequenceNumber,omitempty"`
    // contains filtered or unexported fields
}

Addenda10 is an addenda which provides business transaction information for Addenda Type Code 10 in a machine readable format. It is usually formatted according to ANSI, ASC, X12 Standard.

Addenda10 is mandatory for IAT entries

The Addenda10 Record identifies the Receiver of the transaction and the dollar amount of the payment.

func NewAddenda10 Uses

func NewAddenda10() *Addenda10

NewAddenda10 returns a new Addenda10 with default values for none exported fields

func (*Addenda10) CalculateCheckDigit Uses

func (v *Addenda10) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*Addenda10) EntryDetailSequenceNumberField Uses

func (addenda10 *Addenda10) EntryDetailSequenceNumberField() string

EntryDetailSequenceNumberField returns a zero padded EntryDetailSequenceNumber string

func (*Addenda10) ForeignPaymentAmountField Uses

func (addenda10 *Addenda10) ForeignPaymentAmountField() string

ForeignPaymentAmountField returns ForeignPaymentAmount zero padded ToDo: Review/Add logic for blank ?

func (*Addenda10) ForeignTraceNumberField Uses

func (addenda10 *Addenda10) ForeignTraceNumberField() string

ForeignTraceNumberField gets the Foreign TraceNumber left padded

func (*Addenda10) NameField Uses

func (addenda10 *Addenda10) NameField() string

NameField gets the name field - Receiving Company Name/Individual Name left padded

func (*Addenda10) Parse Uses

func (addenda10 *Addenda10) Parse(record string)

Parse takes the input record string and parses the Addenda10 values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*Addenda10) String Uses

func (addenda10 *Addenda10) String() string

String writes the Addenda10 struct to a 94 character string.

func (*Addenda10) Validate Uses

func (addenda10 *Addenda10) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type Addenda11 Uses

type Addenda11 struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // TypeCode Addenda11 types code '11'
    TypeCode string `json:"typeCode"`
    // Originator Name contains the originators name (your company name / name)
    OriginatorName string `json:"originatorName"`
    // Originator Street Address Contains the originators street address (your company's address / your address)
    OriginatorStreetAddress string `json:"originatorStreetAddress"`

    // EntryDetailSequenceNumber contains the ascending sequence number section of the Entry
    // Detail or Corporate Entry Detail Record's trace number This number is
    // the same as the last seven digits of the trace number of the related
    // Entry Detail Record or Corporate Entry Detail Record.
    EntryDetailSequenceNumber int `json:"entryDetailSequenceNumber,omitempty"`
    // contains filtered or unexported fields
}

Addenda11 is an addenda which provides business transaction information for Addenda Type Code 11 in a machine readable format. It is usually formatted according to ANSI, ASC, X12 Standard.

Addenda11 is mandatory for IAT entries

The Addenda11 record identifies key information related to the Originator of the entry.

func NewAddenda11 Uses

func NewAddenda11() *Addenda11

NewAddenda11 returns a new Addenda11 with default values for none exported fields

func (*Addenda11) CalculateCheckDigit Uses

func (v *Addenda11) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*Addenda11) EntryDetailSequenceNumberField Uses

func (addenda11 *Addenda11) EntryDetailSequenceNumberField() string

EntryDetailSequenceNumberField returns a zero padded EntryDetailSequenceNumber string

func (*Addenda11) OriginatorNameField Uses

func (addenda11 *Addenda11) OriginatorNameField() string

OriginatorNameField gets the OriginatorName field - Originator Company Name/Individual Name left padded

func (*Addenda11) OriginatorStreetAddressField Uses

func (addenda11 *Addenda11) OriginatorStreetAddressField() string

OriginatorStreetAddressField gets the OriginatorStreetAddress field - Originator Street Address left padded

func (*Addenda11) Parse Uses

func (addenda11 *Addenda11) Parse(record string)

Parse takes the input record string and parses the Addenda11 values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*Addenda11) String Uses

func (addenda11 *Addenda11) String() string

String writes the Addenda11 struct to a 94 character string.

func (*Addenda11) Validate Uses

func (addenda11 *Addenda11) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type Addenda12 Uses

type Addenda12 struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // TypeCode Addenda12 types code '12'
    TypeCode string `json:"typeCode"`
    // Originator City & State / Province
    // Data elements City and State / Province  should be separated with an asterisk (*) as a delimiter
    // and the field should end with a backslash (\).
    // For example: San Francisco*CA\
    OriginatorCityStateProvince string `json:"originatorCityStateProvince"`
    // Originator Country & Postal Code
    // Data elements must be separated by an asterisk (*) and must end with a backslash (\)
    // For example: US*10036\
    OriginatorCountryPostalCode string `json:"originatorCountryPostalCode"`

    // EntryDetailSequenceNumber contains the ascending sequence number section of the Entry
    // Detail or Corporate Entry Detail Record's trace number This number is
    // the same as the last seven digits of the trace number of the related
    // Entry Detail Record or Corporate Entry Detail Record.
    EntryDetailSequenceNumber int `json:"entryDetailSequenceNumber,omitempty"`
    // contains filtered or unexported fields
}

Addenda12 is an addenda which provides business transaction information for Addenda Type Code 12 in a machine readable format. It is usually formatted according to ANSI, ASC, X12 Standard.

Addenda12 is mandatory for IAT entries

The Addenda12 record identifies key information related to the Originator of the entry.

func NewAddenda12 Uses

func NewAddenda12() *Addenda12

NewAddenda12 returns a new Addenda12 with default values for none exported fields

func (*Addenda12) CalculateCheckDigit Uses

func (v *Addenda12) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*Addenda12) EntryDetailSequenceNumberField Uses

func (addenda12 *Addenda12) EntryDetailSequenceNumberField() string

EntryDetailSequenceNumberField returns a zero padded EntryDetailSequenceNumber string

func (*Addenda12) OriginatorCityStateProvinceField Uses

func (addenda12 *Addenda12) OriginatorCityStateProvinceField() string

OriginatorCityStateProvinceField gets the OriginatorCityStateProvinceField left padded

func (*Addenda12) OriginatorCountryPostalCodeField Uses

func (addenda12 *Addenda12) OriginatorCountryPostalCodeField() string

OriginatorCountryPostalCodeField gets the OriginatorCountryPostalCode field left padded

func (*Addenda12) Parse Uses

func (addenda12 *Addenda12) Parse(record string)

Parse takes the input record string and parses the Addenda12 values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*Addenda12) String Uses

func (addenda12 *Addenda12) String() string

String writes the Addenda12 struct to a 94 character string.

func (*Addenda12) Validate Uses

func (addenda12 *Addenda12) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type Addenda13 Uses

type Addenda13 struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // TypeCode Addenda13 types code '13'
    TypeCode string `json:"typeCode"`
    // Originating DFI Name
    // For Outbound IAT Entries, this field must contain the name of the U.S. ODFI.
    // For Inbound IATs: Name of the foreign bank providing funding for the payment transaction
    ODFIName string `json:"ODFIName"`
    // Originating DFI Identification Number Qualifier
    // For Inbound IATs: The 2-digit code that identifies the numbering scheme used in the
    // Foreign DFI Identification Number field:
    // 01 = National Clearing System
    // 02 = BIC Code
    // 03 = IBAN Code
    ODFIIDNumberQualifier string `json:"ODFIIDNumberQualifier"`
    // Originating DFI Identification
    // This field contains the routing number that identifies the U.S. ODFI initiating the entry.
    // For Inbound IATs: This field contains the bank ID number of the Foreign Bank providing funding
    // for the payment transaction.
    ODFIIdentification string `json:"ODFIIdentification"`
    // Originating DFI Branch Country Code
    // USb” = United States
    //(“b” indicates a blank space)
    // For Inbound IATs: This 3 position field contains a 2-character code as approved by the
    // International Organization for Standardization (ISO) used to identify the country in which
    // the branch of the bank that originated the entry is located. Values for other countries can
    // be found on the International Organization for Standardization website: www.iso.org.
    ODFIBranchCountryCode string `json:"ODFIBranchCountryCode"`

    // EntryDetailSequenceNumber contains the ascending sequence number section of the Entry
    // Detail or Corporate Entry Detail Record's trace number This number is
    // the same as the last seven digits of the trace number of the related
    // Entry Detail Record or Corporate Entry Detail Record.
    EntryDetailSequenceNumber int `json:"entryDetailSequenceNumber,omitempty"`
    // contains filtered or unexported fields
}

Addenda13 is an addenda which provides business transaction information for Addenda Type Code 13 in a machine readable format. It is usually formatted according to ANSI, ASC, X13 Standard.

Addenda13 is mandatory for IAT entries

The Addenda13 contains information related to the financial institution originating the entry. For inbound IAT entries, the Fourth Addenda Record must contain information to identify the foreign financial institution that is providing the funding and payment instruction for the IAT entry.

func NewAddenda13 Uses

func NewAddenda13() *Addenda13

NewAddenda13 returns a new Addenda13 with default values for none exported fields

func (*Addenda13) CalculateCheckDigit Uses

func (v *Addenda13) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*Addenda13) EntryDetailSequenceNumberField Uses

func (addenda13 *Addenda13) EntryDetailSequenceNumberField() string

EntryDetailSequenceNumberField returns a zero padded EntryDetailSequenceNumber string

func (*Addenda13) ODFIBranchCountryCodeField Uses

func (addenda13 *Addenda13) ODFIBranchCountryCodeField() string

ODFIBranchCountryCodeField gets the ODFIBranchCountryCode field left padded

func (*Addenda13) ODFIIDNumberQualifierField Uses

func (addenda13 *Addenda13) ODFIIDNumberQualifierField() string

ODFIIDNumberQualifierField gets the ODFIIDNumberQualifier field left padded

func (*Addenda13) ODFIIdentificationField Uses

func (addenda13 *Addenda13) ODFIIdentificationField() string

ODFIIdentificationField gets the ODFIIdentificationCode field left padded

func (*Addenda13) ODFINameField Uses

func (addenda13 *Addenda13) ODFINameField() string

ODFINameField gets the ODFIName field left padded

func (*Addenda13) Parse Uses

func (addenda13 *Addenda13) Parse(record string)

Parse takes the input record string and parses the Addenda13 values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*Addenda13) String Uses

func (addenda13 *Addenda13) String() string

String writes the Addenda13 struct to a 94 character string.

func (*Addenda13) Validate Uses

func (addenda13 *Addenda13) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type Addenda14 Uses

type Addenda14 struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // TypeCode Addenda14 types code '14'
    TypeCode string `json:"typeCode"`
    // Receiving DFI Name
    // Name of the Receiver's bank
    RDFIName string `json:"RDFIName"`
    // Receiving DFI Identification Number Qualifier
    // The 2-digit code that identifies the numbering scheme used in the
    // Receiving DFI Identification Number field::
    // 01 = National Clearing System
    // 02 = BIC Code
    // 03 = IBAN Code
    RDFIIDNumberQualifier string `json:"RDFIIDNumberQualifier"`
    // Receiving DFI Identification
    // This field contains the bank identification number of the DFI at which the
    // Receiver maintains his account.
    RDFIIdentification string `json:"RDFIIdentification"`
    // Receiving DFI Branch Country Code
    // USb” = United States
    //(“b” indicates a blank space)
    // This 3 position field contains a 2-character code as approved by the International
    // Organization for Standardization (ISO) used to identify the country in which the
    // branch of the bank that receives the entry is located. Values for other countries can
    // be found on the International Organization for Standardization website: www.iso.org
    RDFIBranchCountryCode string `json:"RDFIBranchCountryCode"`

    // EntryDetailSequenceNumber contains the ascending sequence number section of the Entry
    // Detail or Corporate Entry Detail Record's trace number This number is
    // the same as the last seven digits of the trace number of the related
    // Entry Detail Record or Corporate Entry Detail Record.
    EntryDetailSequenceNumber int `json:"entryDetailSequenceNumber,omitempty"`
    // contains filtered or unexported fields
}

Addenda14 is an addenda which provides business transaction information for Addenda Type Code 14 in a machine readable format. It is usually formatted according to ANSI, ASC, X14 Standard.

Addenda14 is mandatory for IAT entries

The Addenda14 identifies the Receiving financial institution holding the Receiver's account.

func NewAddenda14 Uses

func NewAddenda14() *Addenda14

NewAddenda14 returns a new Addenda14 with default values for none exported fields

func (*Addenda14) CalculateCheckDigit Uses

func (v *Addenda14) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*Addenda14) EntryDetailSequenceNumberField Uses

func (addenda14 *Addenda14) EntryDetailSequenceNumberField() string

EntryDetailSequenceNumberField returns a zero padded EntryDetailSequenceNumber string

func (*Addenda14) Parse Uses

func (addenda14 *Addenda14) Parse(record string)

Parse takes the input record string and parses the Addenda14 values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*Addenda14) RDFIBranchCountryCodeField Uses

func (addenda14 *Addenda14) RDFIBranchCountryCodeField() string

RDFIBranchCountryCodeField gets the RDFIBranchCountryCode field left padded

func (*Addenda14) RDFIIDNumberQualifierField Uses

func (addenda14 *Addenda14) RDFIIDNumberQualifierField() string

RDFIIDNumberQualifierField gets the RDFIIDNumberQualifier field left padded

func (*Addenda14) RDFIIdentificationField Uses

func (addenda14 *Addenda14) RDFIIdentificationField() string

RDFIIdentificationField gets the RDFIIdentificationCode field left padded

func (*Addenda14) RDFINameField Uses

func (addenda14 *Addenda14) RDFINameField() string

RDFINameField gets the RDFIName field left padded

func (*Addenda14) String Uses

func (addenda14 *Addenda14) String() string

String writes the Addenda14 struct to a 94 character string.

func (*Addenda14) Validate Uses

func (addenda14 *Addenda14) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type Addenda15 Uses

type Addenda15 struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // TypeCode Addenda15 types code '15'
    TypeCode string `json:"typeCode"`
    // Receiver Identification Number contains the accounting number by which the Originator is known to
    // the Receiver for descriptive purposes. NACHA Rules recommend but do not require the RDFI to print
    // the contents of this field on the receiver's statement.
    ReceiverIDNumber string `json:"receiverIDNumber,omitempty"`
    // Receiver Street Address contains the Receiver‟s physical address
    ReceiverStreetAddress string `json:"receiverStreetAddress"`

    // EntryDetailSequenceNumber contains the ascending sequence number section of the Entry
    // Detail or Corporate Entry Detail Record's trace number This number is
    // the same as the last seven digits of the trace number of the related
    // Entry Detail Record or Corporate Entry Detail Record.
    EntryDetailSequenceNumber int `json:"entryDetailSequenceNumber,omitempty"`
    // contains filtered or unexported fields
}

Addenda15 is an addenda which provides business transaction information for Addenda Type Code 15 in a machine readable format. It is usually formatted according to ANSI, ASC, X12 Standard.

Addenda15 is mandatory for IAT entries

The Addenda15 record identifies key information related to the Receiver.

func NewAddenda15 Uses

func NewAddenda15() *Addenda15

NewAddenda15 returns a new Addenda15 with default values for none exported fields

func (*Addenda15) CalculateCheckDigit Uses

func (v *Addenda15) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*Addenda15) EntryDetailSequenceNumberField Uses

func (addenda15 *Addenda15) EntryDetailSequenceNumberField() string

EntryDetailSequenceNumberField returns a zero padded EntryDetailSequenceNumber string

func (*Addenda15) Parse Uses

func (addenda15 *Addenda15) Parse(record string)

Parse takes the input record string and parses the Addenda15 values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*Addenda15) ReceiverIDNumberField Uses

func (addenda15 *Addenda15) ReceiverIDNumberField() string

ReceiverIDNumberField gets the ReceiverIDNumber field left padded

func (*Addenda15) ReceiverStreetAddressField Uses

func (addenda15 *Addenda15) ReceiverStreetAddressField() string

ReceiverStreetAddressField gets the ReceiverStreetAddressField field left padded

func (*Addenda15) String Uses

func (addenda15 *Addenda15) String() string

String writes the Addenda15 struct to a 94 character string.

func (*Addenda15) Validate Uses

func (addenda15 *Addenda15) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type Addenda16 Uses

type Addenda16 struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // TypeCode Addenda16 types code '16'
    TypeCode string `json:"typeCode"`
    // Receiver City & State / Province
    // Data elements City and State / Province  should be separated with an asterisk (*) as a delimiter
    // and the field should end with a backslash (\).
    // For example: San Francisco*CA\
    ReceiverCityStateProvince string `json:"receiverCityStateProvince"`
    // Receiver Country & Postal Code
    // Data elements must be separated by an asterisk (*) and must end with a backslash (\)
    // For example: US*10036\
    ReceiverCountryPostalCode string `json:"receiverCountryPostalCode"`

    // EntryDetailSequenceNumber contains the ascending sequence number section of the Entry
    // Detail or Corporate Entry Detail Record's trace number This number is
    // the same as the last seven digits of the trace number of the related
    // Entry Detail Record or Corporate Entry Detail Record.
    EntryDetailSequenceNumber int `json:"entryDetailSequenceNumber,omitempty"`
    // contains filtered or unexported fields
}

Addenda16 is an addenda which provides business transaction information for Addenda Type Code 16 in a machine readable format. It is usually formatted according to ANSI, ASC, X16 Standard.

Addenda16 is mandatory for IAT entries

The Addenda16 record identifies key information related to the Receiver.

func NewAddenda16 Uses

func NewAddenda16() *Addenda16

NewAddenda16 returns a new Addenda16 with default values for none exported fields

func (*Addenda16) CalculateCheckDigit Uses

func (v *Addenda16) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*Addenda16) EntryDetailSequenceNumberField Uses

func (addenda16 *Addenda16) EntryDetailSequenceNumberField() string

EntryDetailSequenceNumberField returns a zero padded EntryDetailSequenceNumber string

func (*Addenda16) Parse Uses

func (addenda16 *Addenda16) Parse(record string)

Parse takes the input record string and parses the Addenda16 values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*Addenda16) ReceiverCityStateProvinceField Uses

func (addenda16 *Addenda16) ReceiverCityStateProvinceField() string

ReceiverCityStateProvinceField gets the ReceiverCityStateProvinceField left padded

func (*Addenda16) ReceiverCountryPostalCodeField Uses

func (addenda16 *Addenda16) ReceiverCountryPostalCodeField() string

ReceiverCountryPostalCodeField gets the ReceiverCountryPostalCode field left padded

func (*Addenda16) String Uses

func (addenda16 *Addenda16) String() string

String writes the Addenda16 struct to a 94 character string.

func (*Addenda16) Validate Uses

func (addenda16 *Addenda16) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type Addenda17 Uses

type Addenda17 struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // TypeCode Addenda17 types code '17'
    TypeCode string `json:"typeCode"`
    // PaymentRelatedInformation
    PaymentRelatedInformation string `json:"paymentRelatedInformation"`
    // SequenceNumber is consecutively assigned to each Addenda17 Record following
    // an Entry Detail Record. The first addenda17 sequence number must always
    // be a "1".
    SequenceNumber int `json:"sequenceNumber,omitempty"`
    // EntryDetailSequenceNumber contains the ascending sequence number section of the Entry
    // Detail or Corporate Entry Detail Record's trace number This number is
    // the same as the last seven digits of the trace number of the related
    // Entry Detail Record or Corporate Entry Detail Record.
    EntryDetailSequenceNumber int `json:"entryDetailSequenceNumber,omitempty"`
    // contains filtered or unexported fields
}

Addenda17 is an addenda which provides business transaction information for Addenda Type Code 17 in a machine readable format. It is usually formatted according to ANSI, ASC, X12 Standard.

Addenda17 is optional for IAT entries

The Addenda17 record identifies payment-related data. A maximum of two of these Addenda Records may be included with each IAT entry.

func NewAddenda17 Uses

func NewAddenda17() *Addenda17

NewAddenda17 returns a new Addenda17 with default values for none exported fields

func (*Addenda17) CalculateCheckDigit Uses

func (v *Addenda17) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*Addenda17) EntryDetailSequenceNumberField Uses

func (addenda17 *Addenda17) EntryDetailSequenceNumberField() string

EntryDetailSequenceNumberField returns a zero padded EntryDetailSequenceNumber string

func (*Addenda17) Parse Uses

func (addenda17 *Addenda17) Parse(record string)

Parse takes the input record string and parses the Addenda17 values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*Addenda17) PaymentRelatedInformationField Uses

func (addenda17 *Addenda17) PaymentRelatedInformationField() string

PaymentRelatedInformationField returns a zero padded PaymentRelatedInformation string

func (*Addenda17) SequenceNumberField Uses

func (addenda17 *Addenda17) SequenceNumberField() string

SequenceNumberField returns a zero padded SequenceNumber string

func (*Addenda17) String Uses

func (addenda17 *Addenda17) String() string

String writes the Addenda17 struct to a 94 character string.

func (*Addenda17) Validate Uses

func (addenda17 *Addenda17) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type Addenda18 Uses

type Addenda18 struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // TypeCode Addenda18 types code '18'
    TypeCode string `json:"typeCode"`
    // ForeignCorrespondentBankName contains the name of the Foreign Correspondent Bank
    ForeignCorrespondentBankName string `json:"foreignCorrespondentBankName"`
    // Foreign Correspondent Bank Identification Number Qualifier contains a 2-digit code that
    // identifies the numbering scheme used in the Foreign Correspondent Bank Identification Number
    // field. Code values for this field are:
    // “01” = National Clearing System
    // “02” = BIC Code
    // “03” = IBAN Code
    ForeignCorrespondentBankIDNumberQualifier string `json:"foreignCorrespondentBankIDNumberQualifier"`
    // Foreign Correspondent Bank Identification Number contains the bank ID number of the Foreign
    // Correspondent Bank
    ForeignCorrespondentBankIDNumber string `json:"foreignCorrespondentBankIDNumber"`
    // Foreign Correspondent Bank Branch Country Code contains the two-character code, as approved by
    // the International Organization for Standardization (ISO), to identify the country in which the
    // branch of the Foreign Correspondent Bank is located. Values can be found on the International
    // Organization for Standardization website: www.iso.org
    ForeignCorrespondentBankBranchCountryCode string `json:"foreignCorrespondentBankBranchCountryCode"`

    // SequenceNumber is consecutively assigned to each Addenda18 Record following
    // an Entry Detail Record. The first addenda18 sequence number must always
    // be a "1".
    SequenceNumber int `json:"sequenceNumber,omitempty"`
    // EntryDetailSequenceNumber contains the ascending sequence number section of the Entry
    // Detail or Corporate Entry Detail Record's trace number This number is
    // the same as the last seven digits of the trace number of the related
    // Entry Detail Record or Corporate Entry Detail Record.
    EntryDetailSequenceNumber int `json:"entryDetailSequenceNumber,omitempty"`
    // contains filtered or unexported fields
}

Addenda18 is an addenda which provides business transaction information for Addenda Type Code 18 in a machine readable format. It is usually formatted according to ANSI, ASC, X12 Standard.

Addenda18 is optional for IAT entries

The Addenda18 record identifies information on each Foreign Correspondent Bank involved in the processing of the IAT entry. If no Foreign Correspondent Bank is involved,t he record should not be included. A maximum of five of these Addenda Records may be included with each IAT entry.

func NewAddenda18 Uses

func NewAddenda18() *Addenda18

NewAddenda18 returns a new Addenda18 with default values for none exported fields

func (*Addenda18) CalculateCheckDigit Uses

func (v *Addenda18) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*Addenda18) EntryDetailSequenceNumberField Uses

func (addenda18 *Addenda18) EntryDetailSequenceNumberField() string

EntryDetailSequenceNumberField returns a zero padded EntryDetailSequenceNumber string

func (*Addenda18) ForeignCorrespondentBankBranchCountryCodeField Uses

func (addenda18 *Addenda18) ForeignCorrespondentBankBranchCountryCodeField() string

ForeignCorrespondentBankBranchCountryCodeField returns a zero padded ForeignCorrespondentBankBranchCountryCode string

func (*Addenda18) ForeignCorrespondentBankIDNumberField Uses

func (addenda18 *Addenda18) ForeignCorrespondentBankIDNumberField() string

ForeignCorrespondentBankIDNumberField returns a zero padded ForeignCorrespondentBankIDNumber string

func (*Addenda18) ForeignCorrespondentBankIDNumberQualifierField Uses

func (addenda18 *Addenda18) ForeignCorrespondentBankIDNumberQualifierField() string

ForeignCorrespondentBankIDNumberQualifierField returns a zero padded ForeignCorrespondentBankIDNumberQualifier string

func (*Addenda18) ForeignCorrespondentBankNameField Uses

func (addenda18 *Addenda18) ForeignCorrespondentBankNameField() string

ForeignCorrespondentBankNameField returns a zero padded ForeignCorrespondentBankName string

func (*Addenda18) Parse Uses

func (addenda18 *Addenda18) Parse(record string)

Parse takes the input record string and parses the Addenda18 values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*Addenda18) SequenceNumberField Uses

func (addenda18 *Addenda18) SequenceNumberField() string

SequenceNumberField returns a zero padded SequenceNumber string

func (*Addenda18) String Uses

func (addenda18 *Addenda18) String() string

String writes the Addenda18 struct to a 94 character string.

func (*Addenda18) Validate Uses

func (addenda18 *Addenda18) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type Addenda98 Uses

type Addenda98 struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // TypeCode Addenda types code '98'
    TypeCode string `json:"typeCode"`
    // ChangeCode field contains a standard code used by an ACH Operator or RDFI to describe the reason for a change Entry.
    // Must exist in changeCodeDict
    ChangeCode string `json:"changeCode"`
    // OriginalTrace This field contains the Trace Number as originally included on the forward Entry or Prenotification.
    // The RDFI must include the Original Entry Trace Number in the Addenda Record of an Entry being returned to an ODFI,
    // in the Addenda Record of an 98, within an Acknowledgment Entry, or with an RDFI request for a copy of an authorization.
    OriginalTrace string `json:"originalTrace"`
    // OriginalDFI field contains the Receiving DFI Identification (addenda.RDFIIdentification) as originally included on the forward Entry or Prenotification that the RDFI is returning or correcting.
    OriginalDFI string `json:"originalDFI"`
    // CorrectedData
    CorrectedData string `json:"correctedData"`
    // TraceNumber matches the Entry Detail Trace Number of the entry being returned.
    //
    // Use TraceNumberField() for a properly formatted string representation.
    TraceNumber string `json:"traceNumber,omitempty"`
    // contains filtered or unexported fields
}

Addenda98 is a Addendumer addenda record format for Notification OF Change(98) The field contents for Notification of Change Entries must match the field contents of the original Entries

func NewAddenda98 Uses

func NewAddenda98() *Addenda98

NewAddenda98 returns an reference to an instantiated Addenda98 with default values

func (*Addenda98) CalculateCheckDigit Uses

func (v *Addenda98) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*Addenda98) CorrectedDataField Uses

func (addenda98 *Addenda98) CorrectedDataField() string

CorrectedDataField returns a space padded CorrectedData string

func (*Addenda98) OriginalDFIField Uses

func (addenda98 *Addenda98) OriginalDFIField() string

OriginalDFIField returns a zero padded OriginalDFI string

func (*Addenda98) OriginalTraceField Uses

func (addenda98 *Addenda98) OriginalTraceField() string

OriginalTraceField returns a zero padded OriginalTrace string

func (*Addenda98) Parse Uses

func (addenda98 *Addenda98) Parse(record string)

Parse takes the input record string and parses the Addenda98 values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*Addenda98) String Uses

func (addenda98 *Addenda98) String() string

String writes the Addenda98 struct to a 94 character string

func (*Addenda98) TraceNumberField Uses

func (addenda98 *Addenda98) TraceNumberField() string

TraceNumberField returns a zero padded traceNumber string

func (*Addenda98) Validate Uses

func (addenda98 *Addenda98) Validate() error

Validate verifies NACHA rules for Addenda98

type Addenda99 Uses

type Addenda99 struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // TypeCode Addenda types code '99'
    TypeCode string `json:"typeCode"`
    // ReturnCode field contains a standard code used by an ACH Operator or RDFI to describe the reason for returning an Entry.
    // Must exist in returnCodeDict
    ReturnCode string `json:"returnCode"`
    // OriginalTrace This field contains the Trace Number as originally included on the forward Entry or Prenotification.
    // The RDFI must include the Original Entry Trace Number in the Addenda Record of an Entry being returned to an ODFI,
    // in the Addenda Record of an 98, within an Acknowledgment Entry, or with an RDFI request for a copy of an authorization.
    OriginalTrace string `json:"originalTrace"`
    // DateOfDeath The field date of death is to be supplied on Entries being returned for reason of death (return reason codes R14 and R15). Format: YYMMDD (Y=Year, M=Month, D=Day)
    DateOfDeath string `json:"dateOfDeath"`
    // OriginalDFI field contains the Receiving DFI Identification (addenda.RDFIIdentification) as originally included on the forward Entry or Prenotification that the RDFI is returning or correcting.
    OriginalDFI string `json:"originalDFI"`
    // AddendaInformation
    AddendaInformation string `json:"addendaInformation,omitempty"`
    // TraceNumber matches the Entry Detail Trace Number of the entry being returned.
    //
    // Use TraceNumberField() for a properly formatted string representation.
    TraceNumber string `json:"traceNumber,omitempty"`
    // contains filtered or unexported fields
}

Addenda99 utilized for Notification of Change Entry (COR) and Return types.

func NewAddenda99 Uses

func NewAddenda99() *Addenda99

NewAddenda99 returns a new Addenda99 with default values for none exported fields

func (*Addenda99) AddendaInformationField Uses

func (Addenda99 *Addenda99) AddendaInformationField() string

AddendaInformationField returns a space padded AddendaInformation string

func (*Addenda99) CalculateCheckDigit Uses

func (v *Addenda99) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*Addenda99) DateOfDeathField Uses

func (Addenda99 *Addenda99) DateOfDeathField() string

DateOfDeathField returns a space padded DateOfDeath string

func (*Addenda99) IATAddendaInformation Uses

func (Addenda99 *Addenda99) IATAddendaInformation(s string)

IATAddendaInformation sets Addenda Information for IAT return items, characters 10-44 of underlying AddendaInformation

func (*Addenda99) IATAddendaInformationField Uses

func (Addenda99 *Addenda99) IATAddendaInformationField() string

IATAddendaInformationField returns a space padded AddendaInformation string, characters 10-44 of underlying AddendaInformation

func (*Addenda99) IATPaymentAmount Uses

func (Addenda99 *Addenda99) IATPaymentAmount(s string)

IATPaymentAmount sets original forward entry payment amount characters 1-10 of underlying AddendaInformation

func (*Addenda99) IATPaymentAmountField Uses

func (Addenda99 *Addenda99) IATPaymentAmountField() int

IATPaymentAmountField returns original forward entry payment amount int, characters 1-10 of underlying AddendaInformation

func (*Addenda99) OriginalDFIField Uses

func (Addenda99 *Addenda99) OriginalDFIField() string

OriginalDFIField returns a zero padded OriginalDFI string

func (*Addenda99) OriginalTraceField Uses

func (Addenda99 *Addenda99) OriginalTraceField() string

OriginalTraceField returns a zero padded OriginalTrace string

func (*Addenda99) Parse Uses

func (Addenda99 *Addenda99) Parse(record string)

Parse takes the input record string and parses the Addenda99 values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*Addenda99) ReturnCodeField Uses

func (Addenda99 *Addenda99) ReturnCodeField() *ReturnCode

ReturnCodeField gives the ReturnCode struct for the given Addenda99 record

func (*Addenda99) String Uses

func (Addenda99 *Addenda99) String() string

String writes the Addenda99 struct to a 94 character string

func (*Addenda99) TraceNumberField Uses

func (Addenda99 *Addenda99) TraceNumberField() string

TraceNumberField returns a zero padded TraceNumber string

func (*Addenda99) Validate Uses

func (Addenda99 *Addenda99) Validate() error

Validate verifies NACHA rules for Addenda99

type Batch Uses

type Batch struct {
    Header     *BatchHeader      `json:"batchHeader,omitempty"`
    Entries    []*EntryDetail    `json:"entryDetails,omitempty"`
    Control    *BatchControl     `json:"batchControl,omitempty"`
    ADVEntries []*ADVEntryDetail `json:"advEntryDetails,omitempty"`
    ADVControl *ADVBatchControl  `json:"advBatchControl,omitempty"`
    // contains filtered or unexported fields
}

Batch holds the Batch Header and Batch Control and all Entry Records

func (*Batch) AddADVEntry Uses

func (batch *Batch) AddADVEntry(entry *ADVEntryDetail)

AddADVEntry appends an ADV EntryDetail to the Batch

func (*Batch) AddEntry Uses

func (batch *Batch) AddEntry(entry *EntryDetail)

AddEntry appends an EntryDetail to the Batch

func (*Batch) Category Uses

func (batch *Batch) Category() string

Category returns batch category

func (*Batch) Create Uses

func (batch *Batch) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*Batch) Equal Uses

func (batch *Batch) Equal(other Batcher) bool

Equal returns true only if two Batch (or any Batcher) objects are equal. Equality is determined by many of the ACH Batch and EntryDetail properties.

func (*Batch) Error Uses

func (b *Batch) Error(field string, err error, values ...interface{}) error

error returns a new BatchError based on err

func (*Batch) GetADVControl Uses

func (batch *Batch) GetADVControl() *ADVBatchControl

GetADVControl returns the current Batch ADVControl

func (*Batch) GetADVEntries Uses

func (batch *Batch) GetADVEntries() []*ADVEntryDetail

GetADVEntries returns a slice of entry details for the batch

func (*Batch) GetControl Uses

func (batch *Batch) GetControl() *BatchControl

GetControl returns the current Batch Control

func (*Batch) GetEntries Uses

func (batch *Batch) GetEntries() []*EntryDetail

GetEntries returns a slice of entry details for the batch

func (*Batch) GetHeader Uses

func (batch *Batch) GetHeader() *BatchHeader

GetHeader returns the current Batch header

func (*Batch) ID Uses

func (batch *Batch) ID() string

ID returns the id of the batch

func (*Batch) IsADV Uses

func (batch *Batch) IsADV() bool

IsADV determines if a batch is batch type ADV - BatchADV

func (*Batch) SetADVControl Uses

func (batch *Batch) SetADVControl(batchADVControl *ADVBatchControl)

SetADVControl appends an BatchADVControl to the Batch

func (*Batch) SetControl Uses

func (batch *Batch) SetControl(batchControl *BatchControl)

SetControl appends an BatchControl to the Batch

func (*Batch) SetHeader Uses

func (batch *Batch) SetHeader(batchHeader *BatchHeader)

SetHeader appends an BatchHeader to the Batch

func (*Batch) SetID Uses

func (batch *Batch) SetID(id string)

SetID sets the batch id

func (*Batch) UnmarshalJSON Uses

func (batch *Batch) UnmarshalJSON(p []byte) error

func (*Batch) ValidTranCodeForServiceClassCode Uses

func (batch *Batch) ValidTranCodeForServiceClassCode(entry *EntryDetail) error

ValidTranCodeForServiceClassCode validates a TransactionCode is valid for a ServiceClassCode

func (*Batch) Validate Uses

func (batch *Batch) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the batch.

func (*Batch) WithOffset Uses

func (b *Batch) WithOffset(off *Offset)

WithOffset sets the Offset information onto a Batch so that during Create a balanced offset record(s) at the end of each batch.

If there are debits, there is a credit offset matching the sum of the debits. If there are credits, there is a debit offset matching the sum of the credits. They are mutually exclusive.

type BatchACK Uses

type BatchACK struct {
    Batch
}

BatchACK is a batch file that handles SEC payment type ACK and ACK+. Acknowledgement of a Corporate credit by the Receiving Depository Financial Institution (RDFI). For commercial accounts only.

func NewBatchACK Uses

func NewBatchACK(bh *BatchHeader) *BatchACK

NewBatchACK returns a *BatchACK

func (*BatchACK) Create Uses

func (batch *BatchACK) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchACK) Validate Uses

func (batch *BatchACK) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the batch.

type BatchADV Uses

type BatchADV struct {
    Batch
}

BatchADV holds the Batch Header and Batch Control and all Entry Records for ADV Entries

The ADV entry identifies a Non-Monetary Entry that is used by an ACH Operator to provide accounting information regarding an entry to participating DFI's. It's an optional service provided by ACH operators and must be requested by a DFI wanting the service.

func NewBatchADV Uses

func NewBatchADV(bh *BatchHeader) *BatchADV

NewBatchADV returns a *BatchADV

func (*BatchADV) Create Uses

func (batch *BatchADV) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchADV) Validate Uses

func (batch *BatchADV) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the batch.

type BatchARC Uses

type BatchARC struct {
    Batch
}

BatchARC holds the BatchHeader and BatchControl and all EntryDetail for ARC Entries.

Accounts Receivable Entry (ARC). A consumer check converted to a one-time ACH debit. The Accounts Receivable (ARC) Entry provides billers the opportunity to initiate single-entry ACH debits to customer accounts by converting checks at the point of receipt through the U.S. mail, at a drop box location or in-person for payment of a bill at a manned location. The biller is required to provide the customer with notice prior to the acceptance of the check that states the receipt of the customer’s check will be deemed as the authorization for an ARC debit entry to the customer’s account. The provision of the notice and the receipt of the check together constitute authorization for the ARC entry. The customer’s check is solely be used as a source document to obtain the routing number, account number and check serial number.

The difference between ARC and POP is that ARC can result from a check mailed in whereas POP is in-person.

func NewBatchARC Uses

func NewBatchARC(bh *BatchHeader) *BatchARC

NewBatchARC returns a *BatchARC

func (*BatchARC) Create Uses

func (batch *BatchARC) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchARC) Validate Uses

func (batch *BatchARC) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the batch.

type BatchATX Uses

type BatchATX struct {
    Batch
}

BatchATX holds the BatchHeader and BatchControl and all EntryDetail for ATX (Acknowledgment) Entries.

The ATX entry is an acknowledgement by the Receiving Depository Financial Institution (RDFI) that a Corporate Credit (CTX) has been received.

func NewBatchATX Uses

func NewBatchATX(bh *BatchHeader) *BatchATX

NewBatchATX returns a *BatchATX

func (*BatchATX) Create Uses

func (batch *BatchATX) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchATX) Validate Uses

func (batch *BatchATX) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the batch.

type BatchBOC Uses

type BatchBOC struct {
    Batch
}

BatchBOC holds the BatchHeader and BatchControl and all EntryDetail for BOC Entries.

Back Office Conversion (BOC) A single entry debit initiated at the point of purchase or at a manned bill payment location to transfer funds through conversion to an ACH debit entry during back office processing.

BOC allows retailers/billers, and ODFIs acting as Originators, to electronically convert checks received at the point-of-purchase as well as at a manned bill payment location into a single-entry ACH debit. The authorization to convert the check will be obtained through a notice at the checkout or manned bill payment location (e.g., loan payment at financial institution’s teller window) and the receipt of the Receiver’s check. The decision to process the check item as an ACH debit will be made in the “back office” instead of at the point-of-purchase. The customer’s check will solely be used as a source document to obtain the routing number, account number and check serial number.

Unlike ARC entries, BOC conversions require the customer to be present and a notice that checks may be converted to BOC ACH entries be posted.

func NewBatchBOC Uses

func NewBatchBOC(bh *BatchHeader) *BatchBOC

NewBatchBOC returns a *BatchBOC

func (*BatchBOC) Create Uses

func (batch *BatchBOC) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchBOC) Validate Uses

func (batch *BatchBOC) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the batch.

type BatchCCD Uses

type BatchCCD struct {
    Batch
}

BatchCCD is a batch file that handles SEC payment type CCD and CCD+. Corporate credit or debit. Identifies an Entry initiated by an Organization to transfer funds to or from an account of that Organization or another Organization. For commercial accounts only.

func NewBatchCCD Uses

func NewBatchCCD(bh *BatchHeader) *BatchCCD

NewBatchCCD returns a *BatchCCD

func (*BatchCCD) Create Uses

func (batch *BatchCCD) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchCCD) Validate Uses

func (batch *BatchCCD) Validate() error

Validate ensures the batch meets NACHA rules specific to this batch type.

type BatchCIE Uses

type BatchCIE struct {
    Batch
}

BatchCIE holds the BatchHeader and BatchControl and all EntryDetail for CIE Entries.

Customer-Initiated Entry (or CIE entry) is a credit entry initiated on behalf of, and upon the instruction of, a consumer to transfer funds to a non-consumer Receiver. CIE entries are usually transmitted to a company for payment of funds that the consumer owes to that company and are initiated by the consumer through some type of online banking product or bill payment service provider. With CIEs, funds owed by the consumer are “pushed” to the biller in the form of an ACH credit, as opposed to the biller’s use of a debit application (e.g., PPD, WEB) to “pull” the funds from a customer’s account.

func NewBatchCIE Uses

func NewBatchCIE(bh *BatchHeader) *BatchCIE

NewBatchCIE returns a *BatchCIE

func (*BatchCIE) Create Uses

func (batch *BatchCIE) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchCIE) Validate Uses

func (batch *BatchCIE) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the batch.

type BatchCOR Uses

type BatchCOR struct {
    Batch
}

BatchCOR COR - Automated Notification of Change (NOC) or Refused Notification of Change This Standard Entry Class Code is used by an RDFI or ODFI when originating a Notification of Change or Refused Notification of Change in automated format. A Notification of Change may be created by an RDFI to notify the ODFI that a posted Entry or Prenotification Entry contains invalid or erroneous information and should be changed.

func NewBatchCOR Uses

func NewBatchCOR(bh *BatchHeader) *BatchCOR

NewBatchCOR returns a *BatchCOR

func (*BatchCOR) Create Uses

func (batch *BatchCOR) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchCOR) Validate Uses

func (batch *BatchCOR) Validate() error

Validate ensures the batch meets NACHA rules specific to this batch type.

type BatchCTX Uses

type BatchCTX struct {
    Batch
}

BatchCTX holds the BatchHeader and BatchControl and all EntryDetail for CTX Entries.

The Corporate Trade Exchange (CTX) application provides the ability to collect and disburse funds and information between companies. Generally it is used by businesses paying one another for goods or services. These payments replace checks with an electronic process of debiting and crediting invoices between the financial institutions of participating companies.

func NewBatchCTX Uses

func NewBatchCTX(bh *BatchHeader) *BatchCTX

NewBatchCTX returns a *BatchCTX

func (*BatchCTX) Create Uses

func (batch *BatchCTX) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchCTX) Validate Uses

func (batch *BatchCTX) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the batch.

type BatchControl Uses

type BatchControl struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // ServiceClassCode ACH Mixed Debits and Credits ‘200’
    // ACH Credits Only ‘220’
    // ACH Debits Only ‘225'
    // Constants: MixedCreditsAnDebits (220), CReditsOnly 9220), DebitsOnly (225)
    // Same as 'ServiceClassCode' in BatchHeaderRecord
    ServiceClassCode int `json:"serviceClassCode"`
    // EntryAddendaCount is a tally of each Entry Detail Record and each Addenda
    // Record processed, within either the batch or file as appropriate.
    EntryAddendaCount int `json:"entryAddendaÇount"`
    // validate the Receiving DFI Identification in each Entry Detail Record is hashed
    // to provide a check against inadvertent alteration of data contents due
    // to hardware failure or program error
    //
    // In this context the Entry Hash is the sum of the corresponding fields in the
    // Entry Detail Records on the file.
    EntryHash int `json:"entryHash"`
    // TotalDebitEntryDollarAmount Contains accumulated Entry debit totals within the batch.
    TotalDebitEntryDollarAmount int `json:"totalDebit"`
    // TotalCreditEntryDollarAmount Contains accumulated Entry credit totals within the batch.
    TotalCreditEntryDollarAmount int `json:"totalCredit"`
    // CompanyIdentification is an alphanumeric code used to identify an Originator
    // The Company Identification Field must be included on all
    // prenotification records and on each entry initiated pursuant to such
    // prenotification. The Company ID may begin with the ANSI one-digit
    // Identification Code Designator (ICD), followed by the identification
    // number The ANSI Identification Numbers and related Identification Code
    // Designator (ICD) are:
    //
    // IRS Employer Identification Number (EIN) "1"
    // Data Universal Numbering Systems (DUNS) "3"
    // User Assigned Number "9"
    CompanyIdentification string `json:"companyIdentification"`
    // MessageAuthenticationCode the MAC is an eight character code derived from a special key used in
    // conjunction with the DES algorithm. The purpose of the MAC is to
    // validate the authenticity of ACH entries. The DES algorithm and key
    // message standards must be in accordance with standards adopted by the
    // American National Standards Institute. The remaining eleven characters
    // of this field are blank.
    MessageAuthenticationCode string `json:"messageAuthentication,omitempty"`

    // ODFIIdentification the routing number is used to identify the DFI originating entries within a given branch.
    ODFIIdentification string `json:"ODFIIdentification"`
    // BatchNumber this number is assigned in ascending sequence to each batch by the ODFI
    // or its Sending Point in a given file of entries. Since the batch number
    // in the Batch Header Record and the Batch Control Record is the same,
    // the ascending sequence number should be assigned by batch and not by record.
    BatchNumber int `json:"batchNumber"`
    // contains filtered or unexported fields
}

BatchControl contains entry counts, dollar total and has totals for all entries contained in the preceding batch

func NewBatchControl Uses

func NewBatchControl() *BatchControl

NewBatchControl returns a new BatchControl with default values for none exported fields

func (*BatchControl) BatchNumberField Uses

func (bc *BatchControl) BatchNumberField() string

BatchNumberField gets a string of the batch number zero padded

func (*BatchControl) CalculateCheckDigit Uses

func (v *BatchControl) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*BatchControl) CompanyIdentificationField Uses

func (bc *BatchControl) CompanyIdentificationField() string

CompanyIdentificationField get the CompanyIdentification right padded

func (*BatchControl) EntryAddendaCountField Uses

func (bc *BatchControl) EntryAddendaCountField() string

EntryAddendaCountField gets a string of the addenda count zero padded

func (*BatchControl) EntryHashField Uses

func (bc *BatchControl) EntryHashField() string

EntryHashField get a zero padded EntryHash

func (*BatchControl) MessageAuthenticationCodeField Uses

func (bc *BatchControl) MessageAuthenticationCodeField() string

MessageAuthenticationCodeField get the MessageAuthenticationCode right padded

func (*BatchControl) ODFIIdentificationField Uses

func (bc *BatchControl) ODFIIdentificationField() string

ODFIIdentificationField get the odfi number zero padded

func (*BatchControl) Parse Uses

func (bc *BatchControl) Parse(record string)

Parse takes the input record string and parses the EntryDetail values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*BatchControl) String Uses

func (bc *BatchControl) String() string

String writes the BatchControl struct to a 94 character string.

func (*BatchControl) TotalCreditEntryDollarAmountField Uses

func (bc *BatchControl) TotalCreditEntryDollarAmountField() string

TotalCreditEntryDollarAmountField get a zero padded Credit Entry Amount

func (*BatchControl) TotalDebitEntryDollarAmountField Uses

func (bc *BatchControl) TotalDebitEntryDollarAmountField() string

TotalDebitEntryDollarAmountField get a zero padded Debit Entry Amount

func (*BatchControl) Validate Uses

func (bc *BatchControl) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type BatchDNE Uses

type BatchDNE struct {
    Batch
}

BatchDNE is a batch file that handles SEC code Death Notification Entry (DNE) United States Federal agencies (e.g. Social Security) use this to notify depository financial institutions that the recipient of government benefit payments has died.

Notes:

- Date of death always in positions 18-23
- SSN (positions 38-46) are zero if no SSN
- Beneficiary payment starts at position 55

func NewBatchDNE Uses

func NewBatchDNE(bh *BatchHeader) *BatchDNE

NewBatchDNE returns a *BatchDNE

func (*BatchDNE) Amount Uses

func (batch *BatchDNE) Amount() string

Amount returns the amount to be dispursed to the named beneficiary from Addenda05's PaymentRelatedInformation.

func (*BatchDNE) Create Uses

func (batch *BatchDNE) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchDNE) CustomerSSN Uses

func (batch *BatchDNE) CustomerSSN() string

CustomerSSN returns the SSN string from Addenda05's PaymentRelatedInformation

func (*BatchDNE) DateOfDeath Uses

func (batch *BatchDNE) DateOfDeath() string

DateOfDeath returns the YYMMDD string from Addenda05's PaymentRelatedInformation

func (*BatchDNE) Validate Uses

func (batch *BatchDNE) Validate() error

Validate ensures the batch meets NACHA rules specific to this batch type.

type BatchENR Uses

type BatchENR struct {
    Batch
}

BatchENR is a non-monetary entry that enrolls a person with an agency of the US government for a depository financial institution.

Allowed TransactionCode values: 22 Demand Credit, 27 Demand Debit, 32 Savings Credit, 37 Savings Debit

func NewBatchENR Uses

func NewBatchENR(bh *BatchHeader) *BatchENR

NewBatchENR returns a *BatchENR

func (*BatchENR) Create Uses

func (batch *BatchENR) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchENR) ParsePaymentInformation Uses

func (batch *BatchENR) ParsePaymentInformation(addenda05 *Addenda05) (*ENRPaymentInformation, error)

ParsePaymentInformation returns an ENRPaymentInformation for a given Addenda05 record. The information is parsed from the addenda's PaymentRelatedInformation field.

The returned information is not validated for correctness.

func (*BatchENR) Validate Uses

func (batch *BatchENR) Validate() error

Validate ensures the batch meets NACHA rules specific to this batch type.

type BatchError Uses

type BatchError struct {
    BatchNumber int
    BatchType   string
    FieldName   string
    FieldValue  interface{}
    Err         error
}

BatchError is an Error that describes batch validation issues

func (*BatchError) Error Uses

func (e *BatchError) Error() string

func (*BatchError) Unwrap Uses

func (e *BatchError) Unwrap() error

Unwrap implements the base.UnwrappableError interface for BatchError

type BatchHeader Uses

type BatchHeader struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // ServiceClassCode ACH Mixed Debits and Credits ‘200’
    // ACH Credits Only ‘220’
    // ACH Debits Only ‘225'
    ServiceClassCode int `json:"serviceClassCode"`

    // CompanyName the company originating the entries in the batch
    CompanyName string `json:"companyName"`

    // CompanyDiscretionaryData allows Originators and/or ODFIs to include codes (one or more),
    // of significance only to them, to enable specialized handling of all
    // subsequent entries in that batch. There will be no standardized
    // interpretation for the value of the field. This field must be returned
    // intact on any return entry.
    CompanyDiscretionaryData string `json:"companyDiscretionaryData,omitempty"`

    // CompanyIdentification The 9 digit FEIN number (proceeded by a predetermined
    // alpha or numeric character) of the entity in the company name field
    CompanyIdentification string `json:"companyIdentification"`

    // StandardEntryClassCode
    // Identifies the payment type (product) found within an ACH batch-using a 3-character code.
    // The SEC Code pertains to all items within batch.
    // Determines format of the detail records.
    // Determines addenda records (required or optional PLUS one or up to 9,999 records).
    // Determines rules to follow (return time frames).
    // Some SEC codes require specific data in predetermined fields within the ACH record
    StandardEntryClassCode string `json:"standardEntryClassCode,omitempty"`

    // CompanyEntryDescription A description of the entries contained in the batch
    //
    //The Originator establishes the value of this field to provide a
    // description of the purpose of the entry to be displayed back to
    // the receive For example, "GAS BILL," "REG. SALARY," "INS. PREM,"
    // "SOC. SEC.," "DTC," "TRADE PAY," "PURCHASE," etc.
    //
    // This field must contain the word "REVERSAL" (left justified) when the
    // batch contains reversing entries.
    //
    // This field must contain the word "RECLAIM" (left justified) when the
    // batch contains reclamation entries.
    //
    // This field must contain the word "NONSETTLED" (left justified) when the
    // batch contains entries which could not settle.
    CompanyEntryDescription string `json:"companyEntryDescription,omitempty"`
    // CompanyDescriptiveDate currently, the Rules provide that the “Originator establishes this field as the date it
    // would like to see displayed to the Receiver for descriptive purposes.” NACHA recommends that, as desired,
    // the content of this field be formatted using the convention “SDHHMM”, where the “SD” in positions 64- 65 denotes
    // the intent for same-day settlement, and the hours and minutes in positions 66-69 denote the desired settlement
    // time using a 24-hour clock. When electing to use this convention, the ODFI would validate that the field
    // contains either.
    //
    // ODFIs at their discretion may require their Originators to further show intent for
    // same-day settlement using an optional, yet standardized, same-day indicator in the Company Descriptive Date
    // field. The Company Descriptive Date field (5 record, field 8) is an optional field with 6 positions available
    // (positions 64-69).
    CompanyDescriptiveDate string `json:"companyDescriptiveDate,omitempty"`

    // EffectiveEntryDate the date on which the entries are to settle. Format: YYMMDD (Y=Year, M=Month, D=Day)
    EffectiveEntryDate string `json:"effectiveEntryDate,omitempty"`

    // OriginatorStatusCode refers to the ODFI initiating the Entry.
    // 0 ADV File prepared by an ACH Operator.
    // 1 This code identifies the Originator as a depository financial institution.
    // 2 This code identifies the Originator as a Federal Government entity or agency.
    OriginatorStatusCode int `json:"originatorStatusCode,omitempty"`

    //ODFIIdentification First 8 digits of the originating DFI transit routing number
    ODFIIdentification string `json:"ODFIIdentification"`

    // BatchNumber is assigned in ascending sequence to each batch by the ODFI
    // or its Sending Point in a given file of entries. Since the batch number
    // in the Batch Header Record and the Batch Control Record is the same,
    // the ascending sequence number should be assigned by batch and not by
    // record.
    BatchNumber int `json:"batchNumber,omitempty"`
    // contains filtered or unexported fields
}

BatchHeader identifies the originating entity and the type of transactions contained in the batch (i.e., the standard entry class, PPD for consumer, CCD or CTX for corporate). This record also contains the effective date, or desired settlement date, for all entries contained in this batch. The settlement date field is not entered as it is determined by the ACH operator

func NewBatchHeader Uses

func NewBatchHeader() *BatchHeader

NewBatchHeader returns a new BatchHeader with default values for non exported fields

func (*BatchHeader) BatchNumberField Uses

func (bh *BatchHeader) BatchNumberField() string

BatchNumberField get the batch number zero padded

func (*BatchHeader) CalculateCheckDigit Uses

func (v *BatchHeader) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*BatchHeader) CompanyDescriptiveDateField Uses

func (bh *BatchHeader) CompanyDescriptiveDateField() string

CompanyDescriptiveDateField get the CompanyDescriptiveDate left padded

func (*BatchHeader) CompanyDiscretionaryDataField Uses

func (bh *BatchHeader) CompanyDiscretionaryDataField() string

CompanyDiscretionaryDataField get the CompanyDiscretionaryData left padded

func (*BatchHeader) CompanyEntryDescriptionField Uses

func (bh *BatchHeader) CompanyEntryDescriptionField() string

CompanyEntryDescriptionField get the CompanyEntryDescription left padded

func (*BatchHeader) CompanyIdentificationField Uses

func (bh *BatchHeader) CompanyIdentificationField() string

CompanyIdentificationField get the CompanyIdentification left padded

func (*BatchHeader) CompanyNameField Uses

func (bh *BatchHeader) CompanyNameField() string

CompanyNameField get the CompanyName left padded

func (*BatchHeader) EffectiveEntryDateField Uses

func (bh *BatchHeader) EffectiveEntryDateField() string

EffectiveEntryDateField get the EffectiveEntryDate in YYMMDD format

func (*BatchHeader) ODFIIdentificationField Uses

func (bh *BatchHeader) ODFIIdentificationField() string

ODFIIdentificationField get the odfi number zero padded

func (*BatchHeader) Parse Uses

func (bh *BatchHeader) Parse(record string)

Parse takes the input record string and parses the BatchHeader values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*BatchHeader) String Uses

func (bh *BatchHeader) String() string

String writes the BatchHeader struct to a 94 character string.

func (*BatchHeader) Validate Uses

func (bh *BatchHeader) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type BatchMTE Uses

type BatchMTE struct {
    Batch
}

BatchMTE holds the BatchHeader, BatchControl, and EntryDetail for Machine Transfer Entry (MTE) entries.

A MTE transaction is created when a consumer uses their debit card at an Automated Teller Machine (ATM) to withdraw cash. MTE transactions cannot be aggregated together under a single Entry.

func NewBatchMTE Uses

func NewBatchMTE(bh *BatchHeader) *BatchMTE

NewBatchMTE returns a *BatchMTE

func (*BatchMTE) Create Uses

func (batch *BatchMTE) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchMTE) Validate Uses

func (batch *BatchMTE) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the batch.

type BatchPOP Uses

type BatchPOP struct {
    Batch
}

BatchPOP holds the BatchHeader and BatchControl and all EntryDetail for POP Entries.

Point-of-Purchase. A check presented in-person to a merchant for purchase is presented as an ACH entry instead of a physical check.

This ACH debit application is used by originators as a method of payment for the in-person purchase of goods or services by consumers. These Single Entry debit entries are initiated by the originator based on a written authorization and account information drawn from the source document (a check) obtained from the consumer at the point-of-purchase. The source document, which is voided by the merchant and returned to the consumer at the point-of-purchase, is used to collect the consumer’s routing number, account number and check serial number that will be used to generate the debit entry to the consumer’s account.

The difference between POP and ARC is that ARC can result from a check mailed in whereas POP is in-person.

func NewBatchPOP Uses

func NewBatchPOP(bh *BatchHeader) *BatchPOP

NewBatchPOP returns a *BatchPOP

func (*BatchPOP) Create Uses

func (batch *BatchPOP) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchPOP) Validate Uses

func (batch *BatchPOP) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the batch.

type BatchPOS Uses

type BatchPOS struct {
    Batch
}

BatchPOS holds the BatchHeader and BatchControl and all EntryDetail for POS Entries.

A POS Entry is a debit Entry initiated at an “electronic terminal” to a consumer account of the receiver to pay an obligation incurred in a point- of-sale transaction, or to effect a point-of-sale terminal cash withdrawal.

Point-of-Sale Entries (POS) are ACH debit entries typically initiated by the use of a merchant-issued plastic card to pay an obligation at the point-of-sale. Much like a financial institution issued debit card, the merchant- issued debit card is swiped at the point-of-sale and approved for use; however, the authorization only verifies the card is open, active and within the card’s limits—it does not verify the Receiver’s account balance or debit the account at the time of the purchase. Settlement of the transaction moves from the card network to the ACH Network through the creation of a POS entry by the card issuer to debit the Receiver’s account.

func NewBatchPOS Uses

func NewBatchPOS(bh *BatchHeader) *BatchPOS

NewBatchPOS returns a *BatchPOS

func (*BatchPOS) Create Uses

func (batch *BatchPOS) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchPOS) Validate Uses

func (batch *BatchPOS) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the batch.

type BatchPPD Uses

type BatchPPD struct {
    Batch
}

BatchPPD holds the Batch Header and Batch Control and all Entry Records for PPD Entries

func NewBatchPPD Uses

func NewBatchPPD(bh *BatchHeader) *BatchPPD

NewBatchPPD returns a *BatchPPD

func (*BatchPPD) Create Uses

func (batch *BatchPPD) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchPPD) Validate Uses

func (batch *BatchPPD) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the batch.

type BatchRCK Uses

type BatchRCK struct {
    Batch
}

BatchRCK holds the BatchHeader and BatchControl and all EntryDetail for RCK Entries.

Represented Check Entries (RCK). A physical check that was presented but returned because of insufficient funds may be represented as an ACH entry.

func NewBatchRCK Uses

func NewBatchRCK(bh *BatchHeader) *BatchRCK

NewBatchRCK returns a *BatchRCK

func (*BatchRCK) Create Uses

func (batch *BatchRCK) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchRCK) Validate Uses

func (batch *BatchRCK) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the batch.

type BatchSHR Uses

type BatchSHR struct {
    Batch
}

BatchSHR holds the BatchHeader and BatchControl and all EntryDetail for SHR Entries.

Shared Network Entry (SHR) is a debit Entry initiated at an “electronic terminal,” as that term is defined in Regulation E, to a Consumer Account of the Receiver to pay an obligation incurred in a point-of-sale transaction, or to effect a point-of-sale terminal cash withdrawal. Also an adjusting or other credit Entry related to such debit Entry, transfer of funds, or obligation. SHR Entries are initiated in a shared network where the ODFI and RDFI have an agreement in addition to these Rules to process such Entries.

func NewBatchSHR Uses

func NewBatchSHR(bh *BatchHeader) *BatchSHR

NewBatchSHR returns a *BatchSHR

func (*BatchSHR) Create Uses

func (batch *BatchSHR) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchSHR) Validate Uses

func (batch *BatchSHR) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the batch.

type BatchTEL Uses

type BatchTEL struct {
    Batch
}

BatchTEL is a batch that handles SEC payment type Telephone-Initiated Entries (TEL) Telephone-Initiated Entries (TEL) are consumer debit transactions. The NACHA Operating Rules permit TEL entries when the Originator obtains the Receiver’s authorization for the debit entry orally via the telephone. An entry based upon a Receiver’s oral authorization must utilize the TEL (Telephone-Initiated Entry) Standard Entry Class (SEC) Code.

func NewBatchTEL Uses

func NewBatchTEL(bh *BatchHeader) *BatchTEL

NewBatchTEL returns a *BatchTEL

func (*BatchTEL) Create Uses

func (batch *BatchTEL) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchTEL) Validate Uses

func (batch *BatchTEL) Validate() error

Validate ensures the batch meets NACHA rules specific to the SEC type TEL

type BatchTRC Uses

type BatchTRC struct {
    Batch
}

BatchTRC holds the BatchHeader and BatchControl and all EntryDetail for TRC Entries.

Check Truncation Entry (Truncated Entry) is used to identify a debit entry of a truncated check.

func NewBatchTRC Uses

func NewBatchTRC(bh *BatchHeader) *BatchTRC

NewBatchTRC returns a *BatchTRC

func (*BatchTRC) Create Uses

func (batch *BatchTRC) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchTRC) Validate Uses

func (batch *BatchTRC) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the batch.

type BatchTRX Uses

type BatchTRX struct {
    Batch
}

BatchTRX holds the BatchHeader and BatchControl and all EntryDetail for TRX Entries.

Check Truncation Entries Exchange is used to identify a debit entry of a truncated checks (multiple).

func NewBatchTRX Uses

func NewBatchTRX(bh *BatchHeader) *BatchTRX

NewBatchTRX returns a *BatchTRX

func (*BatchTRX) Create Uses

func (batch *BatchTRX) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchTRX) Validate Uses

func (batch *BatchTRX) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the batch.

type BatchWEB Uses

type BatchWEB struct {
    Batch
}

BatchWEB creates a batch file that handles SEC payment type WEB. Entry submitted pursuant to an authorization obtained solely via the Internet or a wireless network For consumer accounts only.

func NewBatchWEB Uses

func NewBatchWEB(bh *BatchHeader) *BatchWEB

NewBatchWEB returns a *BatchWEB

func (*BatchWEB) Create Uses

func (batch *BatchWEB) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchWEB) Validate Uses

func (batch *BatchWEB) Validate() error

Validate ensures the batch meets NACHA rules specific to this batch type.

type BatchXCK Uses

type BatchXCK struct {
    Batch
}

BatchXCK holds the BatchHeader and BatchControl and all EntryDetail for XCK Entries.

Destroyed Check Entry identifies a debit entry initiated for a XCK eligible items.

func NewBatchXCK Uses

func NewBatchXCK(bh *BatchHeader) *BatchXCK

NewBatchXCK returns a *BatchXCK

func (*BatchXCK) Create Uses

func (batch *BatchXCK) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*BatchXCK) Validate Uses

func (batch *BatchXCK) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the batch.

type Batcher Uses

type Batcher interface {
    GetHeader() *BatchHeader
    SetHeader(*BatchHeader)
    GetControl() *BatchControl
    SetControl(*BatchControl)
    GetADVControl() *ADVBatchControl
    SetADVControl(*ADVBatchControl)
    GetEntries() []*EntryDetail
    AddEntry(*EntryDetail)
    GetADVEntries() []*ADVEntryDetail
    AddADVEntry(*ADVEntryDetail)
    Create() error
    Validate() error
    SetID(string)
    ID() string
    // Category defines if a Forward or Return
    Category() string
    Error(string, error, ...interface{}) error
    Equal(other Batcher) bool
    WithOffset(off *Offset)
}

Batcher abstract the different ACH batch types that can exist in a file. Each batch type is defined by SEC (Standard Entry Class) code in the Batch Header * SEC identifies the payment type (product) found within an ACH batch-using a 3-character code * The SEC Code pertains to all items within batch

   * Determines format of the entry detail records
   * Determines addenda records (required or optional PLUS one or up to 9,999 records)
   * Determines rules to follow (return time frames)
	  * Some SEC codes require specific data in predetermined fields within the ACH record

func ConvertBatchType Uses

func ConvertBatchType(b Batch) Batcher

ConvertBatchType will take a batch object and convert it into one of the correct batch type

func NewBatch Uses

func NewBatch(bh *BatchHeader) (Batcher, error)

NewBatch takes a BatchHeader and returns a matching SEC code batch type that is a batcher. Returns an error if the SEC code is not supported.

type ENRPaymentInformation Uses

type ENRPaymentInformation struct {
    // TransactionCode is the Transaction Code of the holder's account
    // Values: 22 (Demand  Credit), 27 (Demand Debit), 32 (Savings Credit), 37 (Savings Debit)
    TransactionCode int

    // RDFIIdentification is the Receiving Depository Identification Number. Typically the first 8 of their ABA routing number.
    RDFIIdentification string

    // CheckDigit is the last digit from an ABA routing number.
    CheckDigit string

    // DFIAccountNumber contains the holder's account number.
    DFIAccountNumber string

    // IndividualIdentification contains the customer's Social Security Number (SSN) for automated enrollments and the
    // taxpayer ID for companies.
    IndividualIdentification string

    // IndividualName is the account holders full name.
    IndividualName string

    // EnrolleeClassificationCode (also called Representative Payee Indicator) returns a code from a specific Addenda05 record.
    // These codes represent:
    //  0: (no)  - Initiated by beneficiary
    //  1: (yes) - Initiated by someone other than named beneficiary
    //  A: Enrollee is a consumer
    //  b: Enrollee is a company
    EnrolleeClassificationCode int
}

ENRPaymentInformation structure

func (*ENRPaymentInformation) String Uses

func (info *ENRPaymentInformation) String() string

type EntryDetail Uses

type EntryDetail struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // TransactionCode if the receivers account is checking, savings, general ledger (GL) or loan.
    TransactionCode int `json:"transactionCode"`
    // RDFIIdentification is the RDFI's routing number without the last digit.
    // Receiving Depository Financial Institution
    RDFIIdentification string `json:"RDFIIdentification"`
    // CheckDigit the last digit of the RDFI's routing number
    CheckDigit string `json:"checkDigit"`
    // DFIAccountNumber is the receiver's bank account number you are crediting/debiting.
    // It important to note that this is an alphanumeric field, so its space padded, no zero padded
    DFIAccountNumber string `json:"DFIAccountNumber"`
    // Amount Number of cents you are debiting/crediting this account
    Amount int `json:"amount"`
    // IdentificationNumber an internal identification (alphanumeric) that
    // you use to uniquely identify this Entry Detail Record
    IdentificationNumber string `json:"identificationNumber,omitempty"`
    // IndividualName The name of the receiver, usually the name on the bank account
    IndividualName string `json:"individualName"`
    // DiscretionaryData allows ODFIs to include codes, of significance only to them,
    // to enable specialized handling of the entry. There will be no
    // standardized interpretation for the value of this field. It can either
    // be a single two-character code, or two distinct one-character codes,
    // according to the needs of the ODFI and/or Originator involved. This
    // field must be returned intact for any returned entry.
    //
    // WEB and TEL batches use the Discretionary Data Field as the Payment Type Code
    DiscretionaryData string `json:"discretionaryData,omitempty"`
    // AddendaRecordIndicator indicates the existence of an Addenda Record.
    // A value of "1" indicates that one ore more addenda records follow,
    // and "0" means no such record is present.
    AddendaRecordIndicator int `json:"addendaRecordIndicator,omitempty"`
    // TraceNumber assigned by the ODFI in ascending sequence, is included in each
    // Entry Detail Record, Corporate Entry Detail Record, and addenda Record.
    // Trace Numbers uniquely identify each entry within a batch in an ACH input file.
    // In association with the Batch Number, transmission (File Creation) Date,
    // and File ID Modifier, the Trace Number uniquely identifies an entry within a given file.
    // For addenda Records, the Trace Number will be identical to the Trace Number
    // in the associated Entry Detail Record, since the Trace Number is associated
    // with an entry or item rather than a physical record.
    //
    // Use TraceNumberField() for a properly formatted string representation.
    TraceNumber string `json:"traceNumber,omitempty"`
    // Addenda02 for use with StandardEntryClassCode MTE, POS, and SHR
    Addenda02 *Addenda02 `json:"addenda02,omitempty"`
    // Addenda05 for use with StandardEntryClassCode: ACK, ATX, CCD, CIE, CTX, DNE, ENR, WEB, PPD, TRX.
    Addenda05 []*Addenda05 `json:"addenda05,omitempty"`
    // Addenda98 for user with NOC
    Addenda98 *Addenda98 `json:"addenda98,omitempty"`
    // Addenda99 for use with Returns
    Addenda99 *Addenda99 `json:"addenda99,omitempty"`
    // Category defines if the entry is a Forward, Return, or NOC
    Category string `json:"category,omitempty"`
    // contains filtered or unexported fields
}

EntryDetail contains the actual transaction data for an individual entry. Fields include those designating the entry as a deposit (credit) or withdrawal (debit), the transit routing number for the entry recipient’s financial institution, the account number (left justify,no zero fill), name, and dollar amount.

func NewEntryDetail Uses

func NewEntryDetail() *EntryDetail

NewEntryDetail returns a new EntryDetail with default values for non exported fields

func (*EntryDetail) AddAddenda05 Uses

func (ed *EntryDetail) AddAddenda05(addenda05 *Addenda05)

AddAddenda05 appends an Addenda05 to the EntryDetail

func (*EntryDetail) AmountField Uses

func (ed *EntryDetail) AmountField() string

AmountField returns a zero padded string of amount

func (*EntryDetail) CATXAddendaRecordsField Uses

func (ed *EntryDetail) CATXAddendaRecordsField() string

CATXAddendaRecordsField is used in CTX and ATX files, characters 1-4 of underlying IndividualName field

func (*EntryDetail) CATXReceivingCompanyField Uses

func (ed *EntryDetail) CATXReceivingCompanyField() string

CATXReceivingCompanyField is used in CTX and ATX files, characters 5-20 of underlying IndividualName field

func (*EntryDetail) CATXReservedField Uses

func (ed *EntryDetail) CATXReservedField() string

CATXReservedField is used in CTX and ATX files, characters 21-22 of underlying IndividualName field

func (*EntryDetail) CalculateCheckDigit Uses

func (v *EntryDetail) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*EntryDetail) CheckSerialNumberField Uses

func (ed *EntryDetail) CheckSerialNumberField() string

CheckSerialNumberField is used in RCK, ARC, BOC files but returns a space padded string of the underlying IdentificationNumber field

func (*EntryDetail) CreditOrDebit Uses

func (ed *EntryDetail) CreditOrDebit() string

CreditOrDebit returns a "C" for credit or "D" for debit based on the entry TransactionCode

func (*EntryDetail) DFIAccountNumberField Uses

func (ed *EntryDetail) DFIAccountNumberField() string

DFIAccountNumberField gets the DFIAccountNumber with space padding

func (*EntryDetail) DiscretionaryDataField Uses

func (ed *EntryDetail) DiscretionaryDataField() string

DiscretionaryDataField returns a space padded string of DiscretionaryData

func (*EntryDetail) IdentificationNumberField Uses

func (ed *EntryDetail) IdentificationNumberField() string

IdentificationNumberField returns a space padded string of IdentificationNumber

func (*EntryDetail) IndividualNameField Uses

func (ed *EntryDetail) IndividualNameField() string

IndividualNameField returns a space padded string of IndividualName

func (*EntryDetail) ItemResearchNumber Uses

func (ed *EntryDetail) ItemResearchNumber() string

ItemResearchNumber getter for TRC Item Research Number characters 7-22 of underlying IndividualName

func (*EntryDetail) ItemTypeIndicator Uses

func (ed *EntryDetail) ItemTypeIndicator() string

ItemTypeIndicator getter for TRC Item Type Indicator which is underlying Discretionary Data

func (*EntryDetail) OriginalTraceNumberField Uses

func (ed *EntryDetail) OriginalTraceNumberField() string

OriginalTraceNumberField is used in ACK and ATX files but returns the underlying IdentificationNumber field

func (*EntryDetail) POPCheckSerialNumberField Uses

func (ed *EntryDetail) POPCheckSerialNumberField() string

POPCheckSerialNumberField is used in POP, characters 1-9 of underlying BatchPOP CheckSerialNumber / IdentificationNumber

func (*EntryDetail) POPTerminalCityField Uses

func (ed *EntryDetail) POPTerminalCityField() string

POPTerminalCityField is used in POP, characters 10-13 of underlying BatchPOP CheckSerialNumber / IdentificationNumber

func (*EntryDetail) POPTerminalStateField Uses

func (ed *EntryDetail) POPTerminalStateField() string

POPTerminalStateField is used in POP, characters 14-15 of underlying BatchPOP CheckSerialNumber / IdentificationNumber

func (*EntryDetail) Parse Uses

func (ed *EntryDetail) Parse(record string)

Parse takes the input record string and parses the EntryDetail values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*EntryDetail) PaymentTypeField Uses

func (ed *EntryDetail) PaymentTypeField() string

PaymentTypeField returns the DiscretionaryData field used in WEB and TEL batch files

func (*EntryDetail) ProcessControlField Uses

func (ed *EntryDetail) ProcessControlField() string

ProcessControlField getter for TRC Process Control Field characters 1-6 of underlying IndividualName

func (*EntryDetail) RDFIIdentificationField Uses

func (ed *EntryDetail) RDFIIdentificationField() string

RDFIIdentificationField get the rdfiIdentification with zero padding

func (*EntryDetail) ReceivingCompanyField Uses

func (ed *EntryDetail) ReceivingCompanyField() string

ReceivingCompanyField is used in CCD files but returns the underlying IndividualName field

func (*EntryDetail) SHRCardExpirationDateField Uses

func (ed *EntryDetail) SHRCardExpirationDateField() string

SHRCardExpirationDateField format MMYY is used in SHR, characters 1-4 of underlying IdentificationNumber

func (*EntryDetail) SHRDocumentReferenceNumberField Uses

func (ed *EntryDetail) SHRDocumentReferenceNumberField() string

SHRDocumentReferenceNumberField format int is used in SHR, characters 5-15 of underlying IdentificationNumber

func (*EntryDetail) SHRIndividualCardAccountNumberField Uses

func (ed *EntryDetail) SHRIndividualCardAccountNumberField() string

SHRIndividualCardAccountNumberField format int is used in SHR, underlying IndividualName

func (*EntryDetail) SetCATXAddendaRecords Uses

func (ed *EntryDetail) SetCATXAddendaRecords(i int)

SetCATXAddendaRecords setter for CTX and ATX AddendaRecords characters 1-4 of underlying IndividualName

func (*EntryDetail) SetCATXReceivingCompany Uses

func (ed *EntryDetail) SetCATXReceivingCompany(s string)

SetCATXReceivingCompany setter for CTX and ATX ReceivingCompany characters 5-20 underlying IndividualName Position 21-22 of underlying Individual Name are reserved blank space for CTX " "

func (*EntryDetail) SetCheckSerialNumber Uses

func (ed *EntryDetail) SetCheckSerialNumber(s string)

SetCheckSerialNumber setter for RCK, ARC, BOC CheckSerialNumber which is underlying IdentificationNumber

func (*EntryDetail) SetItemResearchNumber Uses

func (ed *EntryDetail) SetItemResearchNumber(s string)

SetItemResearchNumber setter for TRC Item Research Number characters 7-22 of underlying IndividualName

func (*EntryDetail) SetItemTypeIndicator Uses

func (ed *EntryDetail) SetItemTypeIndicator(s string)

SetItemTypeIndicator setter for TRC Item Type Indicator which is underlying Discretionary Data

func (*EntryDetail) SetOriginalTraceNumber Uses

func (ed *EntryDetail) SetOriginalTraceNumber(s string)

SetOriginalTraceNumber setter for ACK and ATX OriginalTraceNumber which is underlying IdentificationNumber

func (*EntryDetail) SetPOPCheckSerialNumber Uses

func (ed *EntryDetail) SetPOPCheckSerialNumber(s string)

SetPOPCheckSerialNumber setter for POP CheckSerialNumber which is characters 1-9 of underlying CheckSerialNumber \ IdentificationNumber

func (*EntryDetail) SetPOPTerminalCity Uses

func (ed *EntryDetail) SetPOPTerminalCity(s string)

SetPOPTerminalCity setter for POP Terminal City which is characters 10-13 of underlying CheckSerialNumber \ IdentificationNumber

func (*EntryDetail) SetPOPTerminalState Uses

func (ed *EntryDetail) SetPOPTerminalState(s string)

SetPOPTerminalState setter for POP Terminal State which is characters 14-15 of underlying CheckSerialNumber \ IdentificationNumber

func (*EntryDetail) SetPaymentType Uses

func (ed *EntryDetail) SetPaymentType(t string)

SetPaymentType as R (Recurring) all other values will result in S (single). This is used for WEB and TEL batch files

func (*EntryDetail) SetProcessControlField Uses

func (ed *EntryDetail) SetProcessControlField(s string)

SetProcessControlField setter for TRC Process Control Field characters 1-6 of underlying IndividualName

func (*EntryDetail) SetRDFI Uses

func (ed *EntryDetail) SetRDFI(rdfi string) *EntryDetail

SetRDFI takes the 9 digit RDFI account number and separates it for RDFIIdentification and CheckDigit

func (*EntryDetail) SetReceivingCompany Uses

func (ed *EntryDetail) SetReceivingCompany(s string)

SetReceivingCompany setter for CCD ReceivingCompany which is underlying IndividualName

func (*EntryDetail) SetSHRCardExpirationDate Uses

func (ed *EntryDetail) SetSHRCardExpirationDate(s string)

SetSHRCardExpirationDate format MMYY is used in SHR, characters 1-4 of underlying IdentificationNumber

func (*EntryDetail) SetSHRDocumentReferenceNumber Uses

func (ed *EntryDetail) SetSHRDocumentReferenceNumber(s string)

SetSHRDocumentReferenceNumber format int is used in SHR, characters 5-15 of underlying IdentificationNumber

func (*EntryDetail) SetSHRIndividualCardAccountNumber Uses

func (ed *EntryDetail) SetSHRIndividualCardAccountNumber(s string)

SetSHRIndividualCardAccountNumber format int is used in SHR, underlying IndividualName

func (*EntryDetail) SetTraceNumber Uses

func (ed *EntryDetail) SetTraceNumber(ODFIIdentification string, seq int)

SetTraceNumber takes first 8 digits of ODFI and concatenates a sequence number onto the TraceNumber

func (*EntryDetail) String Uses

func (ed *EntryDetail) String() string

String writes the EntryDetail struct to a 94 character string.

func (*EntryDetail) TraceNumberField Uses

func (ed *EntryDetail) TraceNumberField() string

TraceNumberField returns a zero padded TraceNumber string

func (*EntryDetail) Validate Uses

func (ed *EntryDetail) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type ErrBatchAddendaCount Uses

type ErrBatchAddendaCount struct {
    Message      string
    FoundCount   int
    AllowedCount int
}

ErrBatchAddendaCount is the error given when there are too many addenda than allowed for the batch type

func NewErrBatchAddendaCount Uses

func NewErrBatchAddendaCount(found, allowed int) ErrBatchAddendaCount

NewErrBatchAddendaCount creates a new error of the ErrBatchAddendaCount type

func (ErrBatchAddendaCount) Error Uses

func (e ErrBatchAddendaCount) Error() string

type ErrBatchAddendaTraceNumber Uses

type ErrBatchAddendaTraceNumber struct {
    Message           string
    EntryDetailNumber string
    TraceNumber       string
}

ErrBatchAddendaTraceNumber is the error given when the entry detail sequence number doesn't match the trace number

func NewErrBatchAddendaTraceNumber Uses

func NewErrBatchAddendaTraceNumber(entryDetail, trace string) ErrBatchAddendaTraceNumber

NewErrBatchAddendaTraceNumber creates a new error of the ErrBatchAddendaTraceNumber type

func (ErrBatchAddendaTraceNumber) Error Uses

func (e ErrBatchAddendaTraceNumber) Error() string

type ErrBatchAmount Uses

type ErrBatchAmount struct {
    Message string
    Amount  int
    Limit   int
}

ErrBatchAmount is the error given when the amount exceeds the batch type's limit

func NewErrBatchAmount Uses

func NewErrBatchAmount(amount, limit int) ErrBatchAmount

NewErrBatchAmount creates a new error of the ErrBatchAmount type

func (ErrBatchAmount) Error Uses

func (e ErrBatchAmount) Error() string

type ErrBatchAscending Uses

type ErrBatchAscending struct {
    Message       string
    PreviousTrace interface{}
    CurrentTrace  interface{}
}

ErrBatchAscending is the error given when the trace numbers in a batch are not in ascending order

func NewErrBatchAscending Uses

func NewErrBatchAscending(previous, current interface{}) ErrBatchAscending

NewErrBatchAscending creates a new error of the ErrBatchAscending type

func (ErrBatchAscending) Error Uses

func (e ErrBatchAscending) Error() string

type ErrBatchCalculatedControlEquality Uses

type ErrBatchCalculatedControlEquality struct {
    Message         string
    CalculatedValue interface{}
    ControlValue    interface{}
}

ErrBatchCalculatedControlEquality is the error given when the control record does not match the calculated value

func NewErrBatchCalculatedControlEquality Uses

func NewErrBatchCalculatedControlEquality(calculated, control interface{}) ErrBatchCalculatedControlEquality

NewErrBatchCalculatedControlEquality creates a new error of the ErrBatchCalculatedControlEquality type

func (ErrBatchCalculatedControlEquality) Error Uses

func (e ErrBatchCalculatedControlEquality) Error() string

type ErrBatchCategory Uses

type ErrBatchCategory struct {
    Message   string
    CategoryA string
    CategoryB string
}

ErrBatchCategory is the error given when a batch has entires with two different categories

func NewErrBatchCategory Uses

func NewErrBatchCategory(categoryA, categoryB string) ErrBatchCategory

NewErrBatchCategory creates a new error of the ErrBatchCategory type

func (ErrBatchCategory) Error Uses

func (e ErrBatchCategory) Error() string

type ErrBatchExpectedAddendaCount Uses

type ErrBatchExpectedAddendaCount struct {
    Message       string
    FoundCount    int
    ExpectedCount int
}

ErrBatchExpectedAddendaCount is the error given when the batch type has entries with a field for the number of addenda, and a different number of addenda are foound

func NewErrBatchExpectedAddendaCount Uses

func NewErrBatchExpectedAddendaCount(found, expected int) ErrBatchExpectedAddendaCount

NewErrBatchExpectedAddendaCount creates a new error of the ErrBatchExpectedAddendaCount type

func (ErrBatchExpectedAddendaCount) Error Uses

func (e ErrBatchExpectedAddendaCount) Error() string

type ErrBatchHeaderControlEquality Uses

type ErrBatchHeaderControlEquality struct {
    Message      string
    HeaderValue  interface{}
    ControlValue interface{}
}

ErrBatchHeaderControlEquality is the error given when the control record does not match the calculated value

func NewErrBatchHeaderControlEquality Uses

func NewErrBatchHeaderControlEquality(header, control interface{}) ErrBatchHeaderControlEquality

NewErrBatchHeaderControlEquality creates a new error of the ErrBatchHeaderControlEquality type

func (ErrBatchHeaderControlEquality) Error Uses

func (e ErrBatchHeaderControlEquality) Error() string

type ErrBatchIATNOC Uses

type ErrBatchIATNOC struct {
    Message  string
    Found    interface{}
    Expected interface{}
}

ErrBatchIATNOC is the error given when an IAT batch has an NOC, and there are invalid values

func NewErrBatchIATNOC Uses

func NewErrBatchIATNOC(found, expected interface{}) ErrBatchIATNOC

NewErrBatchIATNOC creates a new error of the ErrBatchIATNOC type

func (ErrBatchIATNOC) Error Uses

func (e ErrBatchIATNOC) Error() string

type ErrBatchRequiredAddendaCount Uses

type ErrBatchRequiredAddendaCount struct {
    Message       string
    FoundCount    int
    RequiredCount int
}

ErrBatchRequiredAddendaCount is the error given when the batch type requires a certain number of addenda, which is not met

func NewErrBatchRequiredAddendaCount Uses

func NewErrBatchRequiredAddendaCount(found, required int) ErrBatchRequiredAddendaCount

NewErrBatchRequiredAddendaCount creates a new error of the ErrBatchRequiredAddendaCount type

func (ErrBatchRequiredAddendaCount) Error Uses

func (e ErrBatchRequiredAddendaCount) Error() string

type ErrBatchServiceClassTranCode Uses

type ErrBatchServiceClassTranCode struct {
    Message          string
    ServiceClassCode int
    TransactionCode  int
}

ErrBatchServiceClassTranCode is the error given when the transaction code is not valid for the batch's service class

func NewErrBatchServiceClassTranCode Uses

func NewErrBatchServiceClassTranCode(serviceClassCode, transactionCode int) ErrBatchServiceClassTranCode

NewErrBatchServiceClassTranCode creates a new error of the ErrBatchServiceClassTranCode type

func (ErrBatchServiceClassTranCode) Error Uses

func (e ErrBatchServiceClassTranCode) Error() string

type ErrBatchTraceNumberNotODFI Uses

type ErrBatchTraceNumberNotODFI struct {
    Message     string
    ODFI        string
    TraceNumber string
}

ErrBatchTraceNumberNotODFI is the error given when a batch's ODFI does not match an entry's trace number

func NewErrBatchTraceNumberNotODFI Uses

func NewErrBatchTraceNumberNotODFI(odfi, trace string) ErrBatchTraceNumberNotODFI

NewErrBatchTraceNumberNotODFI creates a new error of the ErrBatchTraceNumberNotODFI type

func (ErrBatchTraceNumberNotODFI) Error Uses

func (e ErrBatchTraceNumberNotODFI) Error() string

type ErrFileCalculatedControlEquality Uses

type ErrFileCalculatedControlEquality struct {
    Message         string
    Field           string
    CalculatedValue int
    ControlValue    int
}

ErrFileCalculatedControlEquality is the error given when the control record does not match the calculated value

func NewErrFileCalculatedControlEquality Uses

func NewErrFileCalculatedControlEquality(field string, calculated, control int) ErrFileCalculatedControlEquality

NewErrFileCalculatedControlEquality creates a new error of the ErrFileCalculatedControlEquality type

func (ErrFileCalculatedControlEquality) Error Uses

func (e ErrFileCalculatedControlEquality) Error() string

type ErrFileUnknownSEC Uses

type ErrFileUnknownSEC struct {
    Message string
    SEC     string
}

ErrFileUnknownSEC is the error given when a record does not have a known type

func NewErrFileUnknownSEC Uses

func NewErrFileUnknownSEC(secType string) ErrFileUnknownSEC

NewErrFileUnknownSEC creates a new error of the ErrFileUnknownSEC type

func (ErrFileUnknownSEC) Error Uses

func (e ErrFileUnknownSEC) Error() string

type ErrRecordType Uses

type ErrRecordType struct {
    Message      string
    ExpectedType int
}

ErrRecordType is the error given when the field does not have the right record type

func NewErrRecordType Uses

func NewErrRecordType(expectedType int) ErrRecordType

NewErrRecordType creates a new error of the ErrRecordType type

func (ErrRecordType) Error Uses

func (e ErrRecordType) Error() string

type ErrUnknownRecordType Uses

type ErrUnknownRecordType struct {
    Message string
    Type    string
}

ErrUnknownRecordType is the error given when a record does not have a known type

func NewErrUnknownRecordType Uses

func NewErrUnknownRecordType(recordType string) ErrUnknownRecordType

NewErrUnknownRecordType creates a new error of the ErrUnknownRecordType type

func (ErrUnknownRecordType) Error Uses

func (e ErrUnknownRecordType) Error() string

type ErrValidCheckDigit Uses

type ErrValidCheckDigit struct {
    Message              string
    CalculatedCheckDigit int
}

ErrValidCheckDigit is the error given when the observed check digit does not match the calculated one

func NewErrValidCheckDigit Uses

func NewErrValidCheckDigit(digit int) ErrValidCheckDigit

NewErrValidCheckDigit creates a new error of the ErrValidCheckDigit type

func (ErrValidCheckDigit) Error Uses

func (e ErrValidCheckDigit) Error() string

type ErrValidFieldLength Uses

type ErrValidFieldLength struct {
    Message        string
    ExpectedLength int
}

ErrValidFieldLength is the error given when the field does not have the correct length

func NewErrValidFieldLength Uses

func NewErrValidFieldLength(expectedLength int) ErrValidFieldLength

NewErrValidFieldLength creates a new error of the ErrValidFieldLength type

func (ErrValidFieldLength) Error Uses

func (e ErrValidFieldLength) Error() string

type FieldError Uses

type FieldError struct {
    FieldName string      // field name where error happened
    Value     interface{} // value that cause error
    Err       error       // context of the error.
    Msg       string      // deprecated
}

FieldError is returned for errors at a field level in a record

func (*FieldError) Error Uses

func (e *FieldError) Error() string

Error message is constructed FieldName Msg Value Example1: BatchCount $% has none alphanumeric characters Example2: BatchCount 5 is out-of-balance with file count 6

func (*FieldError) Unwrap Uses

func (e *FieldError) Unwrap() error

Unwrap implements the base.UnwrappableError interface for FieldError

type File Uses

type File struct {
    ID         string         `json:"id"`
    Header     FileHeader     `json:"fileHeader"`
    Batches    []Batcher      `json:"batches"`
    IATBatches []IATBatch     `json:"IATBatches"`
    Control    FileControl    `json:"fileControl"`
    ADVControl ADVFileControl `json:"fileADVControl"`

    // NotificationOfChange (Notification of change) is a slice of references to BatchCOR in file.Batches
    NotificationOfChange []Batcher
    // ReturnEntries is a slice of references to file.Batches that contain return entries
    ReturnEntries []Batcher
}

File contains the structures of a parsed ACH File.

func FileFromJSON Uses

func FileFromJSON(bs []byte) (*File, error)

FileFromJSON attempts to return a *File object assuming the input is valid JSON.

Callers should always check for a nil-error before using the returned file.

The File returned may not be valid and callers should confirm with Validate(). Invalid files may be rejected by other Financial Institutions or ACH tools.

func MergeFiles Uses

func MergeFiles(files []*File) ([]*File, error)

MergeFiles is a helper function for consolidating an array of ACH Files into as few files as possible. This is useful for optimizing cost and network efficiency.

Per NACHA rules files must remain under 10,000 lines (when rendered in their ASCII encoding)

File Batches can only be merged if they are unique and routed to and from the same ABA routing numbers.

func NewFile Uses

func NewFile() *File

NewFile constructs a file template.

func (*File) AddBatch Uses

func (f *File) AddBatch(batch Batcher) []Batcher

AddBatch appends a Batch to the ach.File

func (*File) AddIATBatch Uses

func (f *File) AddIATBatch(iatBatch IATBatch) []IATBatch

AddIATBatch appends a IATBatch to the ach.File

func (*File) Create Uses

func (f *File) Create() error

Create will tabulate and assemble an ACH file into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create requires that the FileHeader and at least one Batch be added to the File.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*File) FlattenBatches Uses

func (f *File) FlattenBatches() (*File, error)

FlattenBatches flattens File Batches by consolidating batches with the same BatchHeader data into one batch.

func (*File) IsADV Uses

func (f *File) IsADV() bool

IsADV determines if the File is a File containing ADV batches

func (*File) RemoveBatch Uses

func (f *File) RemoveBatch(batch Batcher)

RemoveBatch will delete a given Batcher from an ach.File

func (*File) SegmentFile Uses

func (f *File) SegmentFile(sfc *SegmentFileConfiguration) (*File, *File, error)

SegmentFile takes a valid ACH File and returns 2 segmented ACH Files, one ACH File containing credit entries and one ACH File containing debit entries. The return is 2 Files a Credit File and Debit File, or an error.: File - Credit File File - Debit File Error - Error or Nil Callers should always check for a nil-error before using the returned file.

The File returned may not be valid and callers should confirm with Validate(). Invalid files may be rejected by other Financial Institutions or ACH tools.

func (*File) SetHeader Uses

func (f *File) SetHeader(h FileHeader) *File

SetHeader allows for header to be built.

func (*File) UnmarshalJSON Uses

func (f *File) UnmarshalJSON(p []byte) error

UnmarshalJSON returns error json struct tag unmarshal is deprecated, use ach.FileFromJSON instead

func (*File) Validate Uses

func (f *File) Validate() error

Validate checks properties of the ACH file to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the file.

type FileControl Uses

type FileControl struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // BatchCount total number of batches (i.e., ‘5’ records) in the file
    BatchCount int `json:"batchCount"`
    // BlockCount total number of records in the file (include all headers and trailer) divided
    // by 10 (This number must be evenly divisible by 10. If not, additional records consisting of all 9’s are added to the file after the initial ‘9’ record to fill out the block 10.)
    BlockCount int `json:"blockCount,omitempty"`
    // EntryAddendaCount is a tally of each Entry Detail Record and each Addenda
    // Record processed, within either the batch or file as appropriate.
    EntryAddendaCount int `json:"entryAddendaCount"`
    // EntryHash calculated in the same manner as the batch has total but includes total from entire file
    EntryHash int `json:"entryHash"`
    // TotalDebitEntryDollarAmountInFile contains accumulated Batch debit totals within the file.
    TotalDebitEntryDollarAmountInFile int `json:"totalDebit"`
    // TotalCreditEntryDollarAmountInFile contains accumulated Batch credit totals within the file.
    TotalCreditEntryDollarAmountInFile int `json:"totalCredit"`
    // contains filtered or unexported fields
}

FileControl record contains entry counts, dollar totals and hash totals accumulated from each batch control record in the file.

func NewFileControl Uses

func NewFileControl() FileControl

NewFileControl returns a new FileControl with default values for none exported fields

func (*FileControl) BatchCountField Uses

func (fc *FileControl) BatchCountField() string

BatchCountField gets a string of the batch count zero padded

func (*FileControl) BlockCountField Uses

func (fc *FileControl) BlockCountField() string

BlockCountField gets a string of the block count zero padded

func (*FileControl) CalculateCheckDigit Uses

func (v *FileControl) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*FileControl) EntryAddendaCountField Uses

func (fc *FileControl) EntryAddendaCountField() string

EntryAddendaCountField gets a string of entry addenda batch count zero padded

func (*FileControl) EntryHashField Uses

func (fc *FileControl) EntryHashField() string

EntryHashField gets a string of entry hash zero padded

func (*FileControl) Parse Uses

func (fc *FileControl) Parse(record string)

Parse takes the input record string and parses the FileControl values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*FileControl) String Uses

func (fc *FileControl) String() string

String writes the FileControl struct to a 94 character string.

func (*FileControl) TotalCreditEntryDollarAmountInFileField Uses

func (fc *FileControl) TotalCreditEntryDollarAmountInFileField() string

TotalCreditEntryDollarAmountInFileField get a zero padded Total credit Entry Amount

func (*FileControl) TotalDebitEntryDollarAmountInFileField Uses

func (fc *FileControl) TotalDebitEntryDollarAmountInFileField() string

TotalDebitEntryDollarAmountInFileField get a zero padded Total debit Entry Amount

func (*FileControl) Validate Uses

func (fc *FileControl) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type FileError Uses

type FileError struct {
    FieldName string
    Value     string
    Msg       string
}

FileError is an error describing issues validating a file

func (FileError) Error Uses

func (e FileError) Error() string

type FileHeader Uses

type FileHeader struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // ImmediateDestination contains the Routing Number of the ACH Operator or receiving
    // point to which the file is being sent.  The ach file format specifies a 10 character
    // field  begins with a blank space in the first position, followed by the four digit
    // Federal Reserve Routing Symbol, the four digit ABA Institution Identifier, and the Check
    // Digit (bTTTTAAAAC).  ImmediateDestinationField() will append the blank space to the
    // routing number.
    ImmediateDestination string `json:"immediateDestination"`

    // ImmediateOrigin contains the Routing Number of the ACH Operator or sending
    // point that is sending the file. The ach file format specifies a 10 character field
    // which can begin with a blank space, 0 or 1 in the first position, followed by the four digit
    // Federal Reserve Routing Symbol, the four digit ABA Institution Identifier, and the Check
    // Digit (bTTTTAAAAC).  ImmediateOriginField() will prepend a 0 to the routing number to match
    // the field size.
    ImmediateOrigin string `json:"immediateOrigin"`

    // FileCreationDate is the date on which the file is prepared by an ODFI (ACH input files)
    // or the date (exchange date) on which a file is transmitted from ACH Operator
    // to ACH Operator, or from ACH Operator to RDFIs (ACH output files).
    //
    // The format is: YYMMDD. Y=Year, M=Month, D=Day
    FileCreationDate string `json:"fileCreationDate"`

    // FileCreationTime is the system time when the ACH file was created.
    //
    // The format is: HHmm. H=Hour, m=Minute
    FileCreationTime string `json:"fileCreationTime"`

    // This field should start at zero and increment by 1 (up to 9) and then go to
    // letters starting at A through Z for each subsequent file that is created for
    // a single system date. (34-34) 1 numeric 0-9 or uppercase alpha A-Z.
    // I have yet to see this ID not A
    FileIDModifier string `json:"fileIDModifier,omitempty"`

    // ImmediateDestinationName us the name of the ACH or receiving point for which that
    // file is destined. Name corresponding to the ImmediateDestination
    ImmediateDestinationName string `json:"immediateDestinationName"`

    // ImmediateOriginName is the name of the ACH operator or sending point that is
    // sending the file. Name corresponding to the ImmediateOrigin
    ImmediateOriginName string `json:"immediateOriginName"`

    // ReferenceCode is reserved for information pertinent to the Originator.
    ReferenceCode string `json:"referenceCode,omitempty"`
    // contains filtered or unexported fields
}

FileHeader is a Record designating physical file characteristics and identify the origin (sending point) and destination (receiving point) of the entries contained in the file. The file header also includes creation date and time fields which can be used to uniquely identify a file.

func NewFileHeader Uses

func NewFileHeader() FileHeader

NewFileHeader returns a new FileHeader with default values for none exported fields

func (*FileHeader) CalculateCheckDigit Uses

func (v *FileHeader) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*FileHeader) FileCreationDateField Uses

func (fh *FileHeader) FileCreationDateField() string

FileCreationDateField gets the file creation date in YYMMDD (year, month, day) format A blank string is returned when an error occurred while parsing the timestamp. ISO 8601 is the only other format supported.

func (*FileHeader) FileCreationTimeField Uses

func (fh *FileHeader) FileCreationTimeField() string

FileCreationTimeField gets the file creation time in HHmm (hour, minute) format A blank string is returned when an error occurred while parsing the timestamp. ISO 8601 is the only other format supported.

func (*FileHeader) ImmediateDestinationField Uses

func (fh *FileHeader) ImmediateDestinationField() string

ImmediateDestinationField gets the immediate destination number with zero padding

func (*FileHeader) ImmediateDestinationNameField Uses

func (fh *FileHeader) ImmediateDestinationNameField() string

ImmediateDestinationNameField gets the ImmediateDestinationName field padded

func (*FileHeader) ImmediateOriginField Uses

func (fh *FileHeader) ImmediateOriginField() string

ImmediateOriginField gets the immediate origin number with 0 padding

func (*FileHeader) ImmediateOriginNameField Uses

func (fh *FileHeader) ImmediateOriginNameField() string

ImmediateOriginNameField gets the ImmImmediateOriginName field padded

func (*FileHeader) Parse Uses

func (fh *FileHeader) Parse(record string)

Parse takes the input record string and parses the FileHeader values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*FileHeader) ReferenceCodeField Uses

func (fh *FileHeader) ReferenceCodeField() string

ReferenceCodeField gets the ReferenceCode field padded

func (*FileHeader) String Uses

func (fh *FileHeader) String() string

String writes the FileHeader struct to a 94 character string.

func (*FileHeader) Validate Uses

func (fh *FileHeader) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops the parsing.

type IATBatch Uses

type IATBatch struct {
    // ID is a client defined string used as a reference to this record.
    ID      string            `json:"id"`
    Header  *IATBatchHeader   `json:"IATBatchHeader,omitempty"`
    Entries []*IATEntryDetail `json:"IATEntryDetails,omitempty"`
    Control *BatchControl     `json:"batchControl,omitempty"`
    // contains filtered or unexported fields
}

IATBatch holds the Batch Header and Batch Control and all Entry Records for an IAT batch

An IAT entry is a credit or debit ACH entry that is part of a payment transaction involving a financial agency’s office (i.e., depository financial institution or business issuing money orders) that is not located in the territorial jurisdiction of the United States. IAT entries can be made to or from a corporate or consumer account and must be accompanied by seven (7) mandatory addenda records identifying the name and physical address of the Originator, name and physical address of the Receiver, Receiver’s account number, Receiver’s bank identity and reason for the payment.

func NewIATBatch Uses

func NewIATBatch(bh *IATBatchHeader) IATBatch

NewIATBatch takes a BatchHeader and returns a matching SEC code batch type that is a batcher. Returns an error if the SEC code is not supported.

func (*IATBatch) AddEntry Uses

func (iatBatch *IATBatch) AddEntry(entry *IATEntryDetail)

AddEntry appends an EntryDetail to the Batch

func (*IATBatch) Category Uses

func (iatBatch *IATBatch) Category() string

Category returns IATBatch Category

func (*IATBatch) Create Uses

func (iatBatch *IATBatch) Create() error

Create will tabulate and assemble an ACH batch into a valid state. This includes setting any posting dates, sequence numbers, counts, and sums.

Create implementations are free to modify computable fields in a file and should call the Batch's Validate() function at the end of their execution.

func (*IATBatch) Error Uses

func (iatBatch *IATBatch) Error(field string, err error, values ...interface{}) error

error returns a new BatchError based on err

func (*IATBatch) GetControl Uses

func (iatBatch *IATBatch) GetControl() *BatchControl

GetControl returns the current Batch Control

func (*IATBatch) GetEntries Uses

func (iatBatch *IATBatch) GetEntries() []*IATEntryDetail

GetEntries returns a slice of entry details for the batch

func (*IATBatch) GetHeader Uses

func (iatBatch *IATBatch) GetHeader() *IATBatchHeader

GetHeader returns the current Batch header

func (*IATBatch) SetControl Uses

func (iatBatch *IATBatch) SetControl(batchControl *BatchControl)

SetControl appends an BatchControl to the Batch

func (*IATBatch) SetHeader Uses

func (iatBatch *IATBatch) SetHeader(batchHeader *IATBatchHeader)

SetHeader appends an BatchHeader to the Batch

func (*IATBatch) UnmarshalJSON Uses

func (iatBatch *IATBatch) UnmarshalJSON(p []byte) error

UnmarshalJSON un-marshals JSON IATBatch

func (*IATBatch) Validate Uses

func (iatBatch *IATBatch) Validate() error

Validate checks properties of the ACH batch to ensure they match NACHA guidelines. This includes computing checksums, totals, and sequence orderings.

Validate will never modify the iatBatch.

type IATBatchHeader Uses

type IATBatchHeader struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // ServiceClassCode ACH Mixed Debits and Credits ‘200’
    // ACH Credits Only ‘220’
    // ACH Debits Only ‘225'
    ServiceClassCode int `json:"serviceClassCode"`

    // IATIndicator - Leave Blank - It is only used for corrected IAT entries
    IATIndicator string `json:"IATIndicator,omitempty"`

    // ForeignExchangeIndicator is a code indicating currency conversion
    //
    // FV Fixed-to-Variable – Entry is originated in a fixed-value amount
    // and is to be received in a variable amount resulting from the
    // execution of the foreign exchange conversion.
    //
    // VF Variable-to-Fixed – Entry is originated in a variable-value
    // amount based on a specific foreign exchange rate for conversion to a
    // fixed-value amount in which the entry is to be received.
    //
    // FF Fixed-to-Fixed – Entry is originated in a fixed-value amount and
    // is to be received in the same fixed-value amount in the same
    // currency denomination. There is no foreign exchange conversion for
    // entries transmitted using this code. For entries originated in a fixed value
    // amount, the foreign Exchange Reference Field will be space
    // filled.
    ForeignExchangeIndicator string `json:"foreignExchangeIndicator"`

    // ForeignExchangeReferenceIndicator is a code used to indicate the content of the
    // Foreign Exchange Reference Field and is filled by the gateway operator.
    // Valid entries are:
    // 1 - Foreign Exchange Rate;
    // 2 - Foreign Exchange Reference Number; or
    // 3 - Space Filled
    ForeignExchangeReferenceIndicator int `json:"foreignExchangeReferenceIndicator"`

    // ForeignExchangeReference  Contains either the foreign exchange rate used to execute
    // the foreign exchange conversion of a cross-border entry or another reference to the foreign
    // exchange transaction.
    ForeignExchangeReference string `json:"foreignExchangeReference"`

    // ISODestinationCountryCode is the two-character code, as approved by the International
    // Organization for Standardization (ISO), to identify the country in which the entry is
    // to be received. Values can be found on the International Organization for Standardization
    // website: www.iso.org.  For entries destined to account holder in the U.S., this would be US.
    ISODestinationCountryCode string `json:"ISODestinationCountryCode"`

    // OriginatorIdentification identifies the following:
    // For U.S. entities: the number assigned will be your tax ID
    // For non-U.S. entities: the number assigned will be your DDA number,
    // or the last 9 characters of your account number if it exceeds 9 characters
    OriginatorIdentification string `json:"originatorIdentification"`

    // StandardEntryClassCode for consumer and non consumer international payments is IAT
    // Identifies the payment type (product) found within an ACH batch-using a 3-character code.
    // The SEC Code pertains to all items within batch.
    // Determines format of the detail records.
    // Determines addenda records (required or optional PLUS one or up to 9,999 records).
    // Determines rules to follow (return time frames).
    // Some SEC codes require specific data in predetermined fields within the ACH record
    StandardEntryClassCode string `json:"standardEntryClassCode,omitempty"`

    // CompanyEntryDescription A description of the entries contained in the batch
    //
    //The Originator establishes the value of this field to provide a
    // description of the purpose of the entry to be displayed back to
    // the receive For example, "GAS BILL," "REG. SALARY," "INS. PREM,"
    // "SOC. SEC.," "DTC," "TRADE PAY," "PURCHASE," etc.
    //
    // This field must contain the word "REVERSAL" (left justified) when the
    // batch contains reversing entries.
    //
    // This field must contain the word "RECLAIM" (left justified) when the
    // batch contains reclamation entries.
    //
    // This field must contain the word "NONSETTLED" (left justified) when the
    // batch contains entries which could not settle.
    CompanyEntryDescription string `json:"companyEntryDescription,omitempty"`

    // ISOOriginatingCurrencyCode is the three-character code, as approved by the International
    // Organization for Standardization (ISO), to identify the currency denomination in which the
    // entry was first originated. If the source of funds is within the territorial jurisdiction
    // of the U.S., enter 'USD', otherwise refer to International Organization for Standardization
    // website for value: www.iso.org -- (Account Currency)
    ISOOriginatingCurrencyCode string `json:"ISOOriginatingCurrencyCode"`

    // ISODestinationCurrencyCode is the three-character code, as approved by the International
    // Organization for Standardization (ISO), to identify the currency denomination in which the
    // entry will ultimately be settled. If the final destination of funds is within the territorial
    // jurisdiction of the U.S., enter “USD”, otherwise refer to International Organization for
    // Standardization website for value: www.iso.org -- (Payment Currency)
    ISODestinationCurrencyCode string `json:"ISODestinationCurrencyCode"`

    // EffectiveEntryDate the date on which the entries are to settle. Format: YYMMDD (Y=Year, M=Month, D=Day)
    EffectiveEntryDate string `json:"effectiveEntryDate,omitempty"`

    // OriginatorStatusCode refers to the ODFI initiating the Entry.
    // 0 ADV File prepared by an ACH Operator.
    // 1 This code identifies the Originator as a depository financial institution.
    // 2 This code identifies the Originator as a Federal Government entity or agency.
    OriginatorStatusCode int `json:"originatorStatusCode,omitempty"`

    // ODFIIdentification First 8 digits of the originating DFI transit routing number
    // For Inbound IAT Entries, this field contains the routing number of the U.S. Gateway
    // Operator.  For Outbound IAT Entries, this field contains the standard routing number,
    // as assigned by Accuity, that identifies the U.S. ODFI initiating the Entry.
    // Format - TTTTAAAA
    ODFIIdentification string `json:"ODFIIdentification"`

    // BatchNumber is assigned in ascending sequence to each batch by the ODFI
    // or its Sending Point in a given file of entries. Since the batch number
    // in the Batch Header Record and the Batch Control Record is the same,
    // the ascending sequence number should be assigned by batch and not by
    // record.
    BatchNumber int `json:"batchNumber,omitempty"`
    // contains filtered or unexported fields
}

IATBatchHeader identifies the originating entity and the type of transactions contained in the batch for SEC Code IAT. This record also contains the effective date, or desired settlement date, for all entries contained in this batch. The settlement date field is not entered as it is determined by the ACH operator.

An IAT entry is a credit or debit ACH entry that is part of a payment transaction involving a financial agency’s office (i.e., depository financial institution or business issuing money orders) that is not located in the territorial jurisdiction of the United States. IAT entries can be made to or from a corporate or consumer account and must be accompanied by seven (7) mandatory addenda records identifying the name and physical address of the Originator, name and physical address of the Receiver, Receiver’s account number, Receiver’s bank identity and reason for the payment.

func NewIATBatchHeader Uses

func NewIATBatchHeader() *IATBatchHeader

NewIATBatchHeader returns a new BatchHeader with default values for non exported fields

func (*IATBatchHeader) BatchNumberField Uses

func (iatBh *IATBatchHeader) BatchNumberField() string

BatchNumberField get the batch number zero padded

func (*IATBatchHeader) CalculateCheckDigit Uses

func (v *IATBatchHeader) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*IATBatchHeader) CompanyEntryDescriptionField Uses

func (iatBh *IATBatchHeader) CompanyEntryDescriptionField() string

CompanyEntryDescriptionField gets the CompanyEntryDescription left padded

func (*IATBatchHeader) EffectiveEntryDateField Uses

func (iatBh *IATBatchHeader) EffectiveEntryDateField() string

EffectiveEntryDateField get the EffectiveEntryDate in YYMMDD format

func (*IATBatchHeader) ForeignExchangeIndicatorField Uses

func (iatBh *IATBatchHeader) ForeignExchangeIndicatorField() string

ForeignExchangeIndicatorField gets the ForeignExchangeIndicator

func (*IATBatchHeader) ForeignExchangeReferenceField Uses

func (iatBh *IATBatchHeader) ForeignExchangeReferenceField() string

ForeignExchangeReferenceField gets the ForeignExchangeReference left padded

func (*IATBatchHeader) ForeignExchangeReferenceIndicatorField Uses

func (iatBh *IATBatchHeader) ForeignExchangeReferenceIndicatorField() string

ForeignExchangeReferenceIndicatorField gets the ForeignExchangeReferenceIndicator

func (*IATBatchHeader) IATIndicatorField Uses

func (iatBh *IATBatchHeader) IATIndicatorField() string

IATIndicatorField gets the IATIndicator left padded

func (*IATBatchHeader) ISODestinationCountryCodeField Uses

func (iatBh *IATBatchHeader) ISODestinationCountryCodeField() string

ISODestinationCountryCodeField gets the ISODestinationCountryCode

func (*IATBatchHeader) ISODestinationCurrencyCodeField Uses

func (iatBh *IATBatchHeader) ISODestinationCurrencyCodeField() string

ISODestinationCurrencyCodeField gets the ISODestinationCurrencyCode

func (*IATBatchHeader) ISOOriginatingCurrencyCodeField Uses

func (iatBh *IATBatchHeader) ISOOriginatingCurrencyCodeField() string

ISOOriginatingCurrencyCodeField gets the ISOOriginatingCurrencyCode

func (*IATBatchHeader) ODFIIdentificationField Uses

func (iatBh *IATBatchHeader) ODFIIdentificationField() string

ODFIIdentificationField get the odfi number zero padded

func (*IATBatchHeader) OriginatorIdentificationField Uses

func (iatBh *IATBatchHeader) OriginatorIdentificationField() string

OriginatorIdentificationField gets the OriginatorIdentification left padded

func (*IATBatchHeader) Parse Uses

func (iatBh *IATBatchHeader) Parse(record string)

Parse takes the input record string and parses the BatchHeader values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*IATBatchHeader) String Uses

func (iatBh *IATBatchHeader) String() string

String writes the BatchHeader struct to a 94 character string.

func (*IATBatchHeader) Validate Uses

func (iatBh *IATBatchHeader) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type IATEntryDetail Uses

type IATEntryDetail struct {
    // ID is a client defined string used as a reference to this record.
    ID  string `json:"id"`

    // TransactionCode if the receivers account is:
    // Credit (deposit) to checking account ‘22’
    // Prenote for credit to checking account ‘23’
    // Debit (withdrawal) to checking account ‘27’
    // Prenote for debit to checking account ‘28’
    // Credit to savings account ‘32’
    // Prenote for credit to savings account ‘33’
    // Debit to savings account ‘37’
    // Prenote for debit to savings account ‘38’
    TransactionCode int `json:"transactionCode"`
    // RDFIIdentification is the RDFI's routing number without the last digit.
    // Receiving Depository Financial Institution
    RDFIIdentification string `json:"RDFIIdentification"`
    // CheckDigit the last digit of the RDFI's routing number
    CheckDigit string `json:"checkDigit"`
    // AddendaRecords is the number of Addenda Records
    AddendaRecords int `json:"AddendaRecords"`

    // Amount Number of cents you are debiting/crediting this account
    Amount int `json:"amount"`
    // DFIAccountNumber is the receiver's bank account number you are crediting/debiting.
    // It important to note that this is an alphanumeric field, so its space padded, no zero padded
    DFIAccountNumber string `json:"DFIAccountNumber"`

    // OFACScreeningIndicator - Leave blank
    OFACScreeningIndicator string `json:"OFACScreeningIndicator"`
    // SecondaryOFACScreeningIndicator - Leave blank
    SecondaryOFACScreeningIndicator string `json:"SecondaryOFACScreeningIndicator"`
    // AddendaRecordIndicator indicates the existence of an Addenda Record.
    // A value of "1" indicates that one or more addenda records follow,
    // and "0" means no such record is present.
    AddendaRecordIndicator int `json:"addendaRecordIndicator,omitempty"`
    // TraceNumber assigned by the ODFI in ascending sequence, is included in each
    // Entry Detail Record, Corporate Entry Detail Record, and addenda Record.
    // Trace Numbers uniquely identify each entry within a batch in an ACH input file.
    // In association with the Batch Number, transmission (File Creation) Date,
    // and File ID Modifier, the Trace Number uniquely identifies an entry within a given file.
    // For addenda Records, the Trace Number will be identical to the Trace Number
    // in the associated Entry Detail Record, since the Trace Number is associated
    // with an entry or item rather than a physical record.
    //
    // Use TraceNumberField() for a properly formatted string representation.
    TraceNumber string `json:"traceNumber,omitempty"`
    // Addenda10 is mandatory for IAT entries
    //
    // The Addenda10 Record identifies the Receiver of the transaction and the dollar amount of
    // the payment.
    Addenda10 *Addenda10 `json:"addenda10,omitempty"`
    // Addenda11 is mandatory for IAT entries
    //
    // The Addenda11 record identifies key information related to the Originator of
    // the entry.
    Addenda11 *Addenda11 `json:"addenda11,omitempty"`
    // Addenda12 is mandatory for IAT entries
    //
    // The Addenda12 record identifies key information related to the Originator of
    // the entry.
    Addenda12 *Addenda12 `json:"addenda12,omitempty"`
    // Addenda13 is mandatory for IAT entries
    //
    // The Addenda13 contains information related to the financial institution originating the entry.
    // For inbound IAT entries, the Fourth Addenda Record must contain information to identify the
    // foreign financial institution that is providing the funding and payment instruction for
    // the IAT entry.
    Addenda13 *Addenda13 `json:"addenda13,omitempty"`
    // Addenda14 is mandatory for IAT entries
    //
    // The Addenda14 identifies the Receiving financial institution holding the Receiver's account.
    Addenda14 *Addenda14 `json:"addenda14,omitempty"`
    // Addenda15 is mandatory for IAT entries
    //
    // The Addenda15 record identifies key information related to the Receiver.
    Addenda15 *Addenda15 `json:"addenda15,omitempty"`
    // Addenda16 is mandatory for IAt entries
    //
    // Addenda16 record identifies additional key information related to the Receiver.
    Addenda16 *Addenda16 `json:"addenda16,omitempty"`
    // Addenda17 is optional for IAT entries
    //
    // This is an optional Addenda Record used to provide payment-related data. There i a maximum of up to two of these
    // Addenda Records with each IAT entry.
    Addenda17 []*Addenda17 `json:"addenda17,omitempty"`
    // Addenda18 is optional for IAT entries
    //
    // This optional addenda record is used to provide information on each Foreign Correspondent Bank involved in the
    // processing of the IAT entry. If no Foreign Correspondent Bank is involved,the record should not be included.
    // A maximum of five Addenda18 records may be included with each IAT entry.
    Addenda18 []*Addenda18 `json:"addenda18,omitempty"`
    // Addenda98 for user with NOC
    Addenda98 *Addenda98 `json:"addenda98,omitempty"`
    // Addenda99 for use with Returns
    Addenda99 *Addenda99 `json:"addenda99,omitempty"`
    // Category defines if the entry is a Forward, Return, or NOC
    Category string `json:"category,omitempty"`
    // contains filtered or unexported fields
}

IATEntryDetail contains the actual transaction data for an individual entry. Fields include those designating the entry as a deposit (credit) or withdrawal (debit), the transit routing number for the entry recipient’s financial institution, the account number (left justify,no zero fill), name, and dollar amount.

func NewIATEntryDetail Uses

func NewIATEntryDetail() *IATEntryDetail

NewIATEntryDetail returns a new IATEntryDetail with default values for non exported fields

func (*IATEntryDetail) AddAddenda17 Uses

func (iatEd *IATEntryDetail) AddAddenda17(addenda17 *Addenda17)

AddAddenda17 appends an Addenda17 to the IATEntryDetail

func (*IATEntryDetail) AddAddenda18 Uses

func (iatEd *IATEntryDetail) AddAddenda18(addenda18 *Addenda18)

AddAddenda18 appends an Addenda18 to the IATEntryDetail

func (*IATEntryDetail) AddendaRecordsField Uses

func (iatEd *IATEntryDetail) AddendaRecordsField() string

AddendaRecordsField returns a zero padded AddendaRecords string

func (*IATEntryDetail) AmountField Uses

func (iatEd *IATEntryDetail) AmountField() string

AmountField returns a zero padded string of amount

func (*IATEntryDetail) CalculateCheckDigit Uses

func (v *IATEntryDetail) CalculateCheckDigit(routingNumber string) int

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor. The weighting factors for each digit are: Position: 1 2 3 4 5 6 7 8 Weights : 3 7 1 3 7 1 3 7 Add the results of the eight multiplications Subtract the sum from the next highest multiple of 10. The result is the Check Digit

func (*IATEntryDetail) DFIAccountNumberField Uses

func (iatEd *IATEntryDetail) DFIAccountNumberField() string

DFIAccountNumberField gets the DFIAccountNumber with space padding

func (*IATEntryDetail) OFACScreeningIndicatorField Uses

func (iatEd *IATEntryDetail) OFACScreeningIndicatorField() string

OFACScreeningIndicatorField gets the OFACScreeningIndicator

func (*IATEntryDetail) Parse Uses

func (iatEd *IATEntryDetail) Parse(record string)

Parse takes the input record string and parses the EntryDetail values

Parse provides no guarantee about all fields being filled in. Callers should make a Validate() call to confirm successful parsing and data validity.

func (*IATEntryDetail) RDFIIdentificationField Uses

func (iatEd *IATEntryDetail) RDFIIdentificationField() string

RDFIIdentificationField get the rdfiIdentification with zero padding

func (*IATEntryDetail) SecondaryOFACScreeningIndicatorField Uses

func (iatEd *IATEntryDetail) SecondaryOFACScreeningIndicatorField() string

SecondaryOFACScreeningIndicatorField gets the SecondaryOFACScreeningIndicator

func (*IATEntryDetail) SetRDFI Uses

func (iatEd *IATEntryDetail) SetRDFI(rdfi string) *IATEntryDetail

SetRDFI takes the 9 digit RDFI account number and separates it for RDFIIdentification and CheckDigit

func (*IATEntryDetail) SetTraceNumber Uses

func (iatEd *IATEntryDetail) SetTraceNumber(ODFIIdentification string, seq int)

SetTraceNumber takes first 8 digits of ODFI and concatenates a sequence number onto the TraceNumber

func (*IATEntryDetail) String Uses

func (iatEd *IATEntryDetail) String() string

String writes the EntryDetail struct to a 94 character string.

func (*IATEntryDetail) TraceNumberField Uses

func (iatEd *IATEntryDetail) TraceNumberField() string

TraceNumberField returns a zero padded TraceNumber string

func (*IATEntryDetail) Validate Uses

func (iatEd *IATEntryDetail) Validate() error

Validate performs NACHA format rule checks on the record and returns an error if not Validated The first error encountered is returned and stops that parsing.

type Offset Uses

type Offset struct {
    RoutingNumber string
    AccountNumber string
    AccountType   OffsetAccountType
    Description   string
}

Offset contains the associated information to append an 'Offset Record' on an ACH batch during Create.

type OffsetAccountType Uses

type OffsetAccountType int
const (
    OffsetChecking OffsetAccountType = 1
    OffsetSavings  OffsetAccountType = 2
)

type Reader Uses

type Reader struct {
    // file is ach.file model being built as r is parsed.
    File File

    // IATCurrentBatch is the current IATBatch entries being parsed
    IATCurrentBatch IATBatch
    // contains filtered or unexported fields
}

Reader reads records from a ACH-encoded file.

func NewReader Uses

func NewReader(r io.Reader) *Reader

NewReader returns a new ACH Reader that reads from r.

func (*Reader) Read Uses

func (r *Reader) Read() (File, error)

Read reads each line of the ACH file and defines which parser to use based on the first character of each line. It also enforces ACH formatting rules and returns the appropriate error if issues are found.

A parsed file may not be valid and callers should ensure the file is validate with Validate() and tabulate the file with Create(). Invalid files may be rejected by other Financial Institutions or ACH tools.

type RecordWrongLengthErr Uses

type RecordWrongLengthErr struct {
    Message string
    Length  int
}

RecordWrongLengthErr is the error given when a record is the wrong length

func NewRecordWrongLengthErr Uses

func NewRecordWrongLengthErr(length int) RecordWrongLengthErr

NewRecordWrongLengthErr creates a new error of the RecordWrongLengthErr type

func (RecordWrongLengthErr) Error Uses

func (e RecordWrongLengthErr) Error() string

type ReturnCode Uses

type ReturnCode struct {
    Code, Reason, Description string
}

ReturnCode holds a return Code, Reason/Title, and Description

Table of return codes exists in Part 4.2 of the NACHA corporate rules and guidelines

type SegmentFileConfiguration Uses

type SegmentFileConfiguration struct{}

SegmentFileConfiguration contains configuration setting for sorting during Segment File Creation.

It is currently not defined, but can/will be expanded later and File.SegmentFile enhanced to use the configuration settings

func NewSegmentFileConfiguration Uses

func NewSegmentFileConfiguration() *SegmentFileConfiguration

SegmentFileConfiguration returns a new SegmentFileConfiguration with default values for non exported fields

type Writer Uses

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

A Writer writes an ach.file to a NACHA encoded file.

As returned by NewWriter, a Writer writes ach.file structs into NACHA formatted files.

func NewWriter Uses

func NewWriter(w io.Writer) *Writer

NewWriter returns a new Writer that writes to w.

func (*Writer) Flush Uses

func (w *Writer) Flush() error

Flush writes any buffered data to the underlying io.Writer.

func (*Writer) Write Uses

func (w *Writer) Write(file *File) error

Writer writes a single ach.file record to w

Directories

PathSynopsis
examples
examples/httpPackage main is an example for creating an Automated Clearing House (ACH) file with Moov's HTTP service.
internal/iso3166Generated on 2019-08-29T10:11:53Z by adam, any modifications will be overwritten
internal/iso4217Generated on 2019-08-29T10:11:56Z by adam, any modifications will be overwritten
internal/usabbrev
server

Package ach imports 16 packages (graph) and is imported by 7 packages. Updated 2019-09-11. Refresh now. Tools for package owners.