Browse Source

TransactionInformation resides in PaymentInformation

master
Gerdriaan Mulder 6 years ago
parent
commit
78c12c3f01
  1. 1
      pain/api.go
  2. 8
      pain/pain.go

1
pain/api.go

@ -12,7 +12,6 @@ func NewDocument(initParty string) *Document {
Contents: &PainXML{ Contents: &PainXML{
GroupHeader: NewGrpHdr(initParty), GroupHeader: NewGrpHdr(initParty),
PaymentInformation: make([]PmtInf, 0), PaymentInformation: make([]PmtInf, 0),
TransactionInformation: make([]TxInf, 0),
}, },
} }
} }

8
pain/pain.go

@ -37,7 +37,6 @@ func (d *Document) Valid() error {
type PainXML struct { type PainXML struct {
GroupHeader *GrpHdr `xml:"GrpHdr"` GroupHeader *GrpHdr `xml:"GrpHdr"`
PaymentInformation []PmtInf `xml:"PmtInf"` PaymentInformation []PmtInf `xml:"PmtInf"`
TransactionInformation []TxInf `xml:"DrctDbtTxInf"`
} }
func (p *PainXML) Valid() error { func (p *PainXML) Valid() error {
@ -48,9 +47,6 @@ func (p *PainXML) Valid() error {
if len(p.PaymentInformation) < 1 { if len(p.PaymentInformation) < 1 {
err = append(err, "no payment information") err = append(err, "no payment information")
} }
if len(p.TransactionInformation) < 1 {
err = append(err, "no transaction information")
}
if len(err) > 0 { if len(err) > 0 {
return fmt.Errorf("pain XML not valid: %v", strings.Join(err, ", ")) return fmt.Errorf("pain XML not valid: %v", strings.Join(err, ", "))
@ -105,10 +101,6 @@ func (meta *PmtTpInf) Valid() error {
return nil return nil
} }
type TxInf struct {
// TODO
}
type PartySEPA2 struct { type PartySEPA2 struct {
PrivateId PersonIdSEPA2 `xml:"PrvtId"` PrivateId PersonIdSEPA2 `xml:"PrvtId"`
} }

Loading…
Cancel
Save