fundflow

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Destination

type Destination struct {
	Customer customers.Customer
	Account  customers.Account

	// AccountNumber contains the decrypted account number from the customers service
	AccountNumber string
}

type FirstParty

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

FirstPerson returns a Strategy for fund flows where PayGate runs as an ACH originator at an FI. This implies funds move in one direction from the FI -- either in or out.

Outgoing credits are debited from the account at the FI without delay and the credits are posted after the RDFI receives the file.

Debiting the remote account means we'll credit our account, but typically hold those funds for a settlement period.

These transfers involve one file with an optional return from the RDFI which should trigger a reversal in the accounting ledger.

func (*FirstParty) HandleReturn

func (fp *FirstParty) HandleReturn(returned *ach.File, xfer *client.Transfer) ([]*ach.File, error)

func (*FirstParty) Originate

func (fp *FirstParty) Originate(companyID string, xfer *client.Transfer, src Source, dst Destination) ([]*ach.File, error)

type MockStrategy

type MockStrategy struct {
	Files []*ach.File
	Err   error
}

func (*MockStrategy) HandleReturn

func (s *MockStrategy) HandleReturn(returned *ach.File, xfer *client.Transfer) ([]*ach.File, error)

func (*MockStrategy) Originate

func (s *MockStrategy) Originate(companyID string, xfer *client.Transfer, source Source, destination Destination) ([]*ach.File, error)

type Source

type Source struct {
	Customer customers.Customer
	Account  customers.Account

	// AccountNumber contains the decrypted account number from the customers service
	AccountNumber string
}

type Strategy

type Strategy interface {
	Originate(companyID string, xfer *client.Transfer, source Source, destination Destination) ([]*ach.File, error)
	HandleReturn(returned *ach.File, xfer *client.Transfer) ([]*ach.File, error)
}

func NewFirstPerson

func NewFirstPerson(logger log.Logger, cfg config.ODFI) Strategy

Jump to

Keyboard shortcuts

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