Version: v0.5.2 Latest Latest

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

Go to latest
Published: Sep 6, 2020 License: MIT Imports: 7 Imported by: 0



Package for ISO 20022 related functionalities. In other words in- and exporting transactions from or to the bank.



View Source
const DateLayout = "2006-01-02"

DateLayout states the default date layout used by the ISO 20022 standard.


This section is empty.


This section is empty.


type BankToCustomerStatement

type BankToCustomerStatement struct {
	CamtPath string
	Currency string

BankToCustomerStatement contains the path to a ISO 20022 camt XML file.

func NewBankToCustomerStatement

func NewBankToCustomerStatement(path, currency string) BankToCustomerStatement

NewBankToCustomerStatement returns a new BankToCustomerStatement with the given path.

func (BankToCustomerStatement) Transactions

func (s BankToCustomerStatement) Transactions() []schema.Transaction

Transactions reads the file for a given statement and returns the Transactions in the Acc data format.

type Document

type Document struct {
	XMLName xml.Name `xml:"Document"`
	Entries []Entry  `xml:"BkToCstmrStmt>Stmt>Ntry"`

Document is the root node of a bank statement.

func (Document) AccTransactions

func (d Document) AccTransactions(currency string) []schema.Transaction

AccTransactions pareses the Transactions of a given file and returns it as Transaction structs.

type Entry

type Entry struct {
	XMLName xml.Name `xml:"Ntry"`
	// Amount of transaction.
	Amount float64 `xml:"Amt"`
	// Booking is a reversal, should be checked.
	ReversalIndicator bool `xml:"RvslInd"`
	// `BOOK` or `PDNG`, in camt.053 only BOOK entries should be apparent.
	Status string `xml:"Sts"`
	// Unique number from the bank, identifies transactions.
	AccountServicerReference string        `xml:"AcctSvcrRef"`
	BookingData              string        `xml:"BookgDt>Dt"`
	ValueData                string        `xml:"ValDt>Dt"`
	Transactions             []Transaction `xml:"NtryDtls>TxDtls"`

Entry is a ISO 20022 entry.

func (Entry) AccTransactions

func (e Entry) AccTransactions(currency string) []schema.Transaction

AccTransactions returns the transactions of a given entry.

type Party

type Party struct {
	Name           string `xml:"Nm"`
	AddressLine    string `xml:"PstlAdr>AdrLine"`
	StreetName     string `xml:"PstlAdr>StrtNm"`
	BuildingNumber int    `xml:"PstlAdr>BldgNb"`
	PostalCode     int    `xml:"PstlAdr>PstCd"`
	TownName       string `xml:"PstlAdr>TwnNm"`
	Country        string `xml:"PstlAdr>Ctry"`

Party reassembles a ISO 20022 party.

func (Party) String

func (p Party) String() string

String returns a human readable string of a given party.

type Transaction

type Transaction struct {
	XMLName              xml.Name `xml:"TxDtls"`
	Amount               string   `xml:"Amt"`
	Description          string   `xml:"RmtInf>Ustrd"`
	CreditDebitIndicator string   `xml:"CdtDbtInd"` // `CRDT` or `DBIT`.
	Creditor             Party    `xml:"RltdPties>Cdtr"`
	Debitor              Party    `xml:"RltdPties>Dbtr"`
	Iban                 string   `xml:"RltdPties>CdtrAcct>Id>IBAN"`
	AccountCode          string   `xml:"RltdPties>CdtrAcct>Id>Othr>Id"`
	BankName             string   `xml:"RltdAgts>CdtrAgt>FinInstnId>Nm"`

Transaction reassembles a ISO 20022 transaction.

func (Transaction) AccTransaction

func (t Transaction) AccTransaction(date, currency string) schema.Transaction

AccTransaction converts an ISO 20022 transaction into a Acc bank account transaction.

func (Transaction) String

func (t Transaction) String() string

String returns a human readable string of a given Transaction.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL