| 1 |
package domain |
| 2 |
|
| 3 |
// BankParameterData represent metadata prvided by a bank institute that |
| 4 |
// reflect limitations and limits when talking to that institute |
| 5 |
type BankParameterData struct { |
| 6 |
Version int |
| 7 |
BankID BankID `yaml:",inline"` |
| 8 |
BankName string `yaml:"bankName"` |
| 9 |
MaxTransactionsPerMessage int `yaml:"maxTransactionsPerMessage"` |
| 10 |
MaxMessageSize int `yaml:"maxMessageSize"` |
| 11 |
MinTimeout int `yaml:"minTimeout"` |
| 12 |
MaxTimeout int `yaml:"maxTimeout"` |
| 13 |
PinTanBusinessTransactions map[string]bool `yaml:"pinTanBusinessTransactions"` |
| 14 |
} |
| 15 |
|
| 16 |
// PinTanBusinessTransaction provides information about whether a given Segment |
| 17 |
// needs a TAN or not. |
| 18 |
type PinTanBusinessTransaction struct { |
| 19 |
SegmentID string `yaml:"segmentID"` |
| 20 |
NeedsTan bool `yaml:"needsTan"` |
| 21 |
} |
| 22 |
|
| 23 |
type PinTanBusinessTransactions []PinTanBusinessTransaction |
| 24 |
|
| 25 |
func (p PinTanBusinessTransactions) NeedsTan(segmentID string) (bool, bool) { |
| 26 |
var transaction *PinTanBusinessTransaction |
| 27 |
for _, tr := range p { |
| 28 |
if tr.SegmentID == segmentID { |
| 29 |
transaction = &tr |
| 30 |
break |
| 31 |
} |
| 32 |
} |
| 33 |
if transaction == nil { |
| 34 |
return false, false |
| 35 |
} |
| 36 |
return transaction.NeedsTan, true |
| 37 |
} |