File: swift.go

package info (click to toggle)
golang-github-mitch000001-go-hbci 0.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,468 kB
  • sloc: java: 1,092; makefile: 5
file content (28 lines) | stat: -rw-r--r-- 738 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package element

import (
	"github.com/mitch000001/go-hbci/swift"
)

// SwiftMT940DataElement represents a DataElement containing SWIFT MT940
// binary data
type SwiftMT940DataElement struct {
	*BinaryDataElement
	swiftMT940Messages *swift.MT940Messages
}

// UnmarshalHBCI unmarshals value into s
func (s *SwiftMT940DataElement) UnmarshalHBCI(value []byte) error {
	s.BinaryDataElement = &BinaryDataElement{}
	err := s.BinaryDataElement.UnmarshalHBCI(value)
	if err != nil {
		return err
	}
	s.swiftMT940Messages = swift.NewMT940Messages(s.BinaryDataElement.Val())
	return nil
}

// Val returns the embodied transactions as *swift.MT940Messages
func (s *SwiftMT940DataElement) Val() *swift.MT940Messages {
	return s.swiftMT940Messages
}