| 1 |
package segment |
| 2 |
|
| 3 |
import ( |
| 4 |
"github.com/mitch000001/go-hbci/domain" |
| 5 |
"github.com/mitch000001/go-hbci/element" |
| 6 |
) |
| 7 |
|
| 8 |
const PinTanBankParameterID = "HIPINS" |
| 9 |
|
| 10 |
type PinTanBankParameter interface { |
| 11 |
BankSegment |
| 12 |
PinTanBusinessTransactions() []domain.PinTanBusinessTransaction |
| 13 |
} |
| 14 |
|
| 15 |
//go:generate go run ../cmd/unmarshaler/unmarshaler_generator.go -segment PinTanBankParameterSegment -segment_interface PinTanBankParameter -segment_versions="PinTanBankParameterV1:1:Segment" |
| 16 |
|
| 17 |
type PinTanBankParameterSegment struct { |
| 18 |
PinTanBankParameter |
| 19 |
} |
| 20 |
|
| 21 |
// PinTanBankParameterV1 |
| 22 |
// |
| 23 |
// PIN/TAN-spezifische Informationen |
| 24 |
type PinTanBankParameterV1 struct { |
| 25 |
Segment |
| 26 |
MaxJobs *element.NumberDataElement `yaml:"MaxJobs"` |
| 27 |
MinSignatures *element.NumberDataElement `yaml:"MinSignatures"` |
| 28 |
// TODO/FIXME: find out which parameters are here actually |
| 29 |
XXX_Unknown *element.NumberDataElement `yaml:"-"` |
| 30 |
PinTanSpecificParams *element.PinTanSpecificParamDataElement `yaml:"PinTanSpecificParams"` |
| 31 |
} |
| 32 |
|
| 33 |
func (t *PinTanBankParameterV1) Version() int { return 1 } |
| 34 |
func (t *PinTanBankParameterV1) ID() string { return PinTanBankParameterID } |
| 35 |
func (t *PinTanBankParameterV1) referencedId() string { return ProcessingPreparationID } |
| 36 |
func (t *PinTanBankParameterV1) sender() string { return senderBank } |
| 37 |
|
| 38 |
func (t *PinTanBankParameterV1) elements() []element.DataElement { |
| 39 |
return []element.DataElement{ |
| 40 |
t.MaxJobs, |
| 41 |
t.MinSignatures, |
| 42 |
t.XXX_Unknown, |
| 43 |
t.PinTanSpecificParams, |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
func (t *PinTanBankParameterV1) PinTanBusinessTransactions() []domain.PinTanBusinessTransaction { |
| 48 |
var transactions []domain.PinTanBusinessTransaction |
| 49 |
for _, transactionDe := range t.PinTanSpecificParams.JobSpecificPinTanInformation.GroupDataElements() { |
| 50 |
transactions = append(transactions, transactionDe.(*element.PinTanBusinessTransactionParameter).Val()) |
| 51 |
} |
| 52 |
return transactions |
| 53 |
} |