sepadebit

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2019 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Creditor

type Creditor struct {
	Name          string        `xml:"Cdtr>Nm"`
	PostalAddress PostalAddress `xml:"Cdtr>PstlAdr,omitempty"`
	IBAN          string        `xml:"CdtrAcct>Id>IBAN"`
	BIC           string        `xml:"CdtrAgt>FinInstnId>BIC"`
	ChargeBearer  string        `xml:"ChrgBr"`
	ID            string        `xml:"CdtrSchmeId>Id>PrvtId>Othr>Id"`
	SchemeName    string        `xml:"CdtrSchmeId>Id>PrvtId>Othr>SchmeNm>Prtry"`
}

func NewCreditor

func NewCreditor() *Creditor

type Date

type Date time.Time

func (Date) MarshalXML

func (d Date) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type Debtor

type Debtor struct {
	BIC  string `xml:"DbtrAgt>FinInstnId>BIC"`
	Name string `xml:"Dbtr>Nm"`
	IBAN string `xml:"DbtrAcct>Id>IBAN"`
}

type Document

type Document struct {
	XMLName          xml.Name        `xml:"Document"`
	XMLNs            string          `xml:"xmlns,attr"`
	XMLxsi           string          `xml:"xmlns:xsi,attr"`
	MsgID            string          `xml:"CstmrDrctDbtInitn>GrpHdr>MsgId"`
	CreationDateTime string          `xml:"CstmrDrctDbtInitn>GrpHdr>CreDtTm"`
	TransacNb        int             `xml:"CstmrDrctDbtInitn>GrpHdr>NbOfTxs"`
	CtrlSum          string          `xml:"CstmrDrctDbtInitn>GrpHdr>CtrlSum"`
	InitiatingParty  InitiatingParty `xml:"CstmrDrctDbtInitn>GrpHdr>InitgPty"`
	Payments         []*Payment      `xml:"CstmrDrctDbtInitn>PmtInf"`
}

Document is the SEPA format for the document containing all transfers

func NewDocument

func NewDocument() *Document

func (*Document) AddPayment

func (d *Document) AddPayment(p *Payment)

func (*Document) SetCreationDateTime

func (d *Document) SetCreationDateTime(t time.Time)

func (*Document) SetInitiatingParty

func (d *Document) SetInitiatingParty(name, id string)

func (*Document) WriteBytes

func (d *Document) WriteBytes() ([]byte, error)

WriteBytes returns XML Serialized document in byte stream

func (*Document) WriteLatin1

func (d *Document) WriteLatin1(w io.Writer) error

WriteLatin1 writes ISO8859-1 XML document to io.Writer argument

type InitiatingParty

type InitiatingParty struct {
	Name   string `xml:"Nm"`
	ID     string `xml:"Id>OrgId>Othr>Id"`
	Scheme string `xml:"Id>OrgId>Othr>SchmeNm>Prtry"`
}

InitiatingParty is the Initiating Party

type Payment

type Payment struct {
	ID                      string `xml:"PmtInfId"`
	Method                  string `xml:"PmtMtd"`
	TransacNb               int    `xml:"NbOfTxs"`
	CtrlSum                 string `xml:"CtrlSum"`
	ServiceLevel            string `xml:"PmtTpInf>SvcLvl>Cd"`
	LocalInstrument         string `xml:"PmtTpInf>LclInstrm>Cd"`
	SequenceType            string `xml:"PmtTpInf>SeqTp"`
	RequestedCollectionDate string `xml:"ReqdColltnDt"`
	*Creditor
	Transactions []Transaction `xml:"DrctDbtTxInf"`
}

func NewPayment

func NewPayment() *Payment

type PostalAddress

type PostalAddress struct {
	Address [2]string `xml:"Adrline,omitempty"`
	Country string    `xml:"Ctry,omitempty"`
}

type TAmount

type TAmount struct {
	Amount   string `xml:",chardata"`
	Currency string `xml:"Ccy,attr"`
}

TAmount is the transaction amount with its currency

type Transaction

type Transaction struct {
	ID        string  `xml:"PmtId>EndToEndId"`
	Amount    TAmount `xml:"InstdAmt"`
	MandateID string  `xml:"DrctDbtTx>MndtRltdInf>MndtId"`
	Date      Date    `xml:"DrctDbtTx>MndtRltdInf>DtOfSgntr"`
	Debtor
	RemittanceInfo string `xml:"RmtInf>Ustrd"`
}

Jump to

Keyboard shortcuts

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