Documentation ¶
Index ¶
- func DecimalsNumber(f float64) int
- func IsValid(iban string) bool
- func ToCents(f float64) (int64, error)
- func ToEuro(i int64) (float64, error)
- type Document
- func (doc *Document) AddTransaction(id string, amount float64, currency string, creditorName string, ...) error
- func (doc *Document) InitDoc(msgID string, creationDate string, executionDate string, emiterName string, ...) error
- func (doc *Document) PrettySerialize() ([]byte, error)
- func (doc *Document) Serialize() ([]byte, error)
- type TAmount
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecimalsNumber ¶
DecimalsNumber returns the number of decimals in a float
Types ¶
type Document ¶
type Document struct { XMLName xml.Name `xml:"Document"` XMLNs string `xml:"xmlns,attr"` XMLxsi string `xml:"xmlns:xsi,attr"` GroupheaderMsgID string `xml:"CstmrCdtTrfInitn>GrpHdr>MsgId"` GroupheaderCreateDate string `xml:"CstmrCdtTrfInitn>GrpHdr>CreDtTm"` GroupheaderTransacNb int `xml:"CstmrCdtTrfInitn>GrpHdr>NbOfTxs"` GroupheaderCtrlSum float64 `xml:"CstmrCdtTrfInitn>GrpHdr>CtrlSum"` GroupheaderEmiterName string `xml:"CstmrCdtTrfInitn>GrpHdr>InitgPty>Nm"` PaymentInfoID string `xml:"CstmrCdtTrfInitn>PmtInf>PmtInfId"` PaymentInfoMethod string `xml:"CstmrCdtTrfInitn>PmtInf>PmtMtd"` PaymentInfoTransacNb int `xml:"CstmrCdtTrfInitn>PmtInf>NbOfTxs"` PaymentInfoCtrlSum float64 `xml:"CstmrCdtTrfInitn>PmtInf>CtrlSum"` PaymentTypeInfo string `xml:"CstmrCdtTrfInitn>PmtInf>PmtTpInf>SvcLvl>Cd"` PaymentExecDate string `xml:"CstmrCdtTrfInitn>PmtInf>ReqdExctnDt"` PaymentEmiterName string `xml:"CstmrCdtTrfInitn>PmtInf>Dbtr>Nm"` PaymentEmiterIBAN string `xml:"CstmrCdtTrfInitn>PmtInf>DbtrAcct>Id>IBAN"` PaymentEmiterBIC string `xml:"CstmrCdtTrfInitn>PmtInf>DbtrAgt>FinInstnId>BIC"` PaymentCharge string `xml:"CstmrCdtTrfInitn>PmtInf>ChrgBr"` PaymentTransactions []Transaction `xml:"CstmrCdtTrfInitn>PmtInf>CdtTrfTxInf"` }
Document is the SEPA format for the document containing all transfers
func (*Document) AddTransaction ¶
func (doc *Document) AddTransaction(id string, amount float64, currency string, creditorName string, creditorIBAN string) error
AddTransaction adds a transfer transaction and adjust the transaction number and the sum control
func (*Document) InitDoc ¶
func (doc *Document) InitDoc(msgID string, creationDate string, executionDate string, emiterName string, emiterIBAN string, emiterBIC string) error
InitDoc fixes every constants in the document + emiter informations
func (*Document) PrettySerialize ¶
PrettySerialize returns the indented xml document in byte stream
type Transaction ¶
type Transaction struct { TransacID string `xml:"PmtId>InstrId"` TransacIDe2e string `xml:"PmtId>EndToEndId"` TransacAmount TAmount `xml:"Amt>InstdAmt"` TransacCreditorName string `xml:"Cdtr>Nm"` TransacCreditorIBAN string `xml:"CdtrAcct>Id>IBAN"` TransacRegulatory string `xml:"RgltryRptg>Dtls>Cd"` TransacMotif string `xml:"RmtInf>Ustrd"` }
Transaction is the transfer SEPA format
Click to show internal directories.
Click to hide internal directories.