models

package
v0.23.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadEvent

func ReadEvent(data []byte, evt interface{}) error

ReadEvent will unmarshal the event, but assumes the event type is known by the caller.

Types

type AESConfig added in v0.5.0

type AESConfig struct {
	Key string
}

func (*AESConfig) MarshalJSON added in v0.6.2

func (cfg *AESConfig) MarshalJSON() ([]byte, error)

type Batch

type Batch struct {
	Header  *ach.BatchHeader   `json:"batchHeader"`
	Entries []*ach.EntryDetail `json:"entryDetails"`
}

type CancelACHFile added in v0.5.1

type CancelACHFile incoming.CancelACHFile

CancelACHFile is an event that achgateway receives to cancel uploading a file to the ODFI.

See the Event struct for wrapping steps.

type CorrectionFile

type CorrectionFile struct {
	Filename    string    `json:"filename"`
	File        *ach.File `json:"file"`
	Corrections []Batch   `json:"corrections"`
}

CorrectionFile is an event for when an Addenda98 record is found within a file from the ODFI. This is also called a "Notification of Change" (NOC).

File.ID will be set to a hash of the Nacha contents.

See the Event struct for wrapping steps.

func (*CorrectionFile) SetValidation added in v0.7.0

func (evt *CorrectionFile) SetValidation(opts *ach.ValidateOpts)

type EncodingConfig added in v0.5.0

type EncodingConfig struct {
	Base64   bool
	Compress bool
}

type EncryptionConfig added in v0.5.0

type EncryptionConfig struct {
	AES *AESConfig
}

type Event

type Event struct {
	Event interface{} `json:"event"`
	Type  string      `json:"type"`
}

Event is a wrapper for all events sent to or received from ACHGateway. It's used to determine the underlying event type.

func Read added in v0.16.0

func Read(data []byte) (*Event, error)

Read will unmarshal an event and return the wrapper for it.

func ReadWithOpts added in v0.19.0

func ReadWithOpts(data []byte, opts *ach.ValidateOpts) (*Event, error)

ReadWithOpts will unmarshal an event with ACH Validation Options

func (Event) Bytes

func (evt Event) Bytes() []byte

func (Event) MarshalJSON

func (evt Event) MarshalJSON() ([]byte, error)

type FileUploaded

type FileUploaded struct {
	FileID     string    `json:"fileID"`
	ShardKey   string    `json:"shardKey"`
	UploadedAt time.Time `json:"uploadedAt"`
}

FileUploaded is an event sent after a queued file has been uploaded to the ODFI. The entries and batches may have been merged into a larger file to optimize on cost, network performance, or other configuration.

type IncomingFile

type IncomingFile struct {
	Filename string    `json:"filename"`
	File     *ach.File `json:"file"`
}

IncomingFile is an event for when an ODFI receives an ACH file from another FI signifying entries to process (e.g. another FI is debiting your account).

File.ID will be set to a hash of the Nacha contents.

See the Event struct for wrapping steps.

func (*IncomingFile) SetValidation added in v0.7.0

func (evt *IncomingFile) SetValidation(opts *ach.ValidateOpts)

type InvalidQueueFile added in v0.23.0

type InvalidQueueFile struct {
	File  QueueACHFile `json:"file"`
	Error string       `json:"error"`
}

InvalidQueueFile is an event that achgateway produces when a QueueACHFile could not be processed. This event is typically produced when the ACH file is invalid.

func (*InvalidQueueFile) SetValidation added in v0.23.0

func (evt *InvalidQueueFile) SetValidation(opts *ach.ValidateOpts)

type PrenoteFile

type PrenoteFile struct {
	Filename string    `json:"filename"`
	File     *ach.File `json:"file"`
	Batches  []Batch   `json:"batches"`
}

PrenoteFile is an event for when an ODFI receives a "pre-notification" ACH file. This type of file is used to validate accounts exist and are usable for ACH.

File.ID will be set to a hash of the Nacha contents.

See the Event struct for wrapping steps.

func (*PrenoteFile) SetValidation added in v0.7.0

func (evt *PrenoteFile) SetValidation(opts *ach.ValidateOpts)

type QueueACHFile added in v0.5.1

type QueueACHFile incoming.ACHFile

QueueACHFile is an event that achgateway receives to enqueue an ACH file for upload to the ODFI at a later cutoff time.

See the Event struct for wrapping steps.

func (*QueueACHFile) SetValidation added in v0.7.0

func (evt *QueueACHFile) SetValidation(opts *ach.ValidateOpts)

type ReconciliationFile

type ReconciliationFile struct {
	Filename        string    `json:"filename"`
	File            *ach.File `json:"file"`
	Reconciliations []Batch   `json:"reconciliations"`
}

ReconciliationFile is a file whose entries match entries initiated with the ODFI.

File.ID will be set to a hash of the Nacha contents.

See the Event struct for wrapping steps.

func (*ReconciliationFile) SetValidation added in v0.7.0

func (evt *ReconciliationFile) SetValidation(opts *ach.ValidateOpts)

type ReturnFile

type ReturnFile struct {
	Filename string    `json:"filename"`
	File     *ach.File `json:"file"`
	Returns  []Batch   `json:"returns"`
}

ReturnFile is an event for when an Addenda99 record is found within a file from the ODFI. This is also called a "return".

File.ID will be set to a hash of the Nacha contents.

See the Event struct for wrapping steps.

func (*ReturnFile) SetValidation added in v0.7.0

func (evt *ReturnFile) SetValidation(opts *ach.ValidateOpts)

type TransformConfig added in v0.5.0

type TransformConfig struct {
	Encoding   *EncodingConfig
	Encryption *EncryptionConfig
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL