Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from fints.fields import DataElementField, DataElementGroupField
from fints.formals import ReferenceMessage, Response
from .base import FinTS3Segment, ParameterSegment, ParameterSegment_22
class HKPRO3(FinTS3Segment):
"""Statusprotokoll anfordern, version 3
Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Formals"""
date_start = DataElementField(type='dat', required=False, _d="Von Datum")
date_end = DataElementField(type='dat', required=False, _d="Bis Datum")
max_number_responses = DataElementField(type='num', max_length=4, required=False, _d="Maximale Anzahl Einträge")
touchdown_point = DataElementField(type='an', max_length=35, required=False, _d="Aufsetzpunkt")
class HIPRO3(FinTS3Segment):
"""Statusprotokoll rückmelden, version 3
Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Formals"""
reference_message = DataElementGroupField(type=ReferenceMessage, _d="Bezugsnachricht")
reference = DataElementField(type='num', max_length=3, required=False, _d='Bezugssegment')
date = DataElementField(type='dat', _d="Datum")
time = DataElementField(type='tim', _d="Uhrzeit")
responses = DataElementGroupField(type=Response, _d="Rückmeldung")
class HIPROS3(ParameterSegment_22):
"""Statusprotokoll Parameter, version 3
type = 'txt'
_DOC_TYPE = str
_FORMAT_STRING = "{}" # FIXME Restrict CRLF
def _parse_value(self, value): return str(value)
class AlphanumericField(TextField):
type = 'an'
class DTAUSField(DataElementField):
type = 'dta'
class NumericField(FieldRenderFormatStringMixin, DataElementField):
type = 'num'
_DOC_TYPE = int
_FORMAT_STRING = "{:d}"
def _parse_value(self, value):
_value = str(value)
if len(_value) > 1 and _value[0] == '0':
raise ValueError("Leading zeroes not allowed for value of type 'num': {!r}".format(value))
return int(_value, 10)
class ZeroPaddedNumericField(NumericField):
type = ''
_DOC_TYPE = int
def __init__(self, *args, **kwargs):
"""Userparameter allgemein"""
user_identifier = DataElementField(type='id', _d="Benutzerkennung")
upd_version = DataElementField(type='num', max_length=3, _d="UPD-Version")
upd_usage = CodeField(UPDUsage, length=1, _d="UPD-Verwendung")
username = DataElementField(type='an', max_length=35, required=False, _d="Benutzername")
extension = DataElementField(type='an', max_length=2048, required=False, _d="Erweiterung, allgemein")
class HIUPD6(FinTS3Segment):
"""Kontoinformationen"""
account_information = DataElementGroupField(type=AccountInformation, required=False, _d="Kontoverbindung")
iban = DataElementField(type='an', max_length=34, _d="IBAN")
customer_id = DataElementField(type='id', _d="Kunden-ID")
account_type = DataElementField(type='num', max_length=2, _d="Kontoart")
account_currency = DataElementField(type='cur', _d="Kontowährung")
name_account_owner_1 = DataElementField(type='an', max_length=27, _d="Name des Kontoinhabers 1")
name_account_owner_2 = DataElementField(type='an', max_length=27, required=False, _d="Name des Kontoinhabers 2")
account_product_name = DataElementField(type='an', max_length=30, required=False, _d="Kontoproduktbezeichnung")
account_limit = DataElementGroupField(type=AccountLimit, required=False, _d="Kontolimit")
allowed_transactions = DataElementGroupField(type=AllowedTransaction, count=999, required=False, _d="Erlaubte Geschäftsvorfälle")
extension = DataElementField(type='an', max_length=2048, required=False, _d="Erweiterung, kontobezogen")
class HKKOM4(FinTS3Segment):
"""Kommunikationszugang anfordern, version 4
Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Formals"""
start_bank_identifier = DataElementGroupField(type=BankIdentifier, required=False, _d="Von Kreditinstitutskennung")
end_bank_identifier = DataElementGroupField(type=BankIdentifier, required=False, _d="Bis Kreditinstitutskennung")
max_number_responses = DataElementField(type='num', max_length=4, required=False, _d="Maximale Anzahl Einträge")
touchdown_point = DataElementField(type='an', max_length=35, required=False, _d="Aufsetzpunkt")
return int(_value, 10)
class DigitsField(FieldRenderFormatStringMixin, DataElementField):
type = 'dig'
_DOC_TYPE = str
_FORMAT_STRING = "{}"
def _parse_value(self, value):
_value = str(value)
if not re.match(r'^\d*$', _value):
raise TypeError("Only digits allowed for value of type 'dig': {!r}".format(value))
return _value
class FloatField(DataElementField):
type = 'float'
_DOC_TYPE = float
_FORMAT_STRING = "{:.12f}" # Warning: Python's float is not exact!
# FIXME: Needs test
def _parse_value(self, value):
if isinstance(value, float):
return value
if isinstance(value, decimal.Decimal):
value = str(value.normalize()).replace(".", ",")
_value = str(value)
if not re.match(r'^(?:0|[1-9]\d*),(?:\d*[1-9]|)$', _value):
raise TypeError("Only digits and ',' allowed for value of type 'float', no superfluous leading or trailing zeroes allowed: {!r}".format(value))
class HIUPA4(FinTS3Segment):
"""Userparameter allgemein"""
user_identifier = DataElementField(type='id', _d="Benutzerkennung")
upd_version = DataElementField(type='num', max_length=3, _d="UPD-Version")
upd_usage = CodeField(UPDUsage, length=1, _d="UPD-Verwendung")
username = DataElementField(type='an', max_length=35, required=False, _d="Benutzername")
extension = DataElementField(type='an', max_length=2048, required=False, _d="Erweiterung, allgemein")
class HIUPD6(FinTS3Segment):
"""Kontoinformationen"""
account_information = DataElementGroupField(type=AccountInformation, required=False, _d="Kontoverbindung")
iban = DataElementField(type='an', max_length=34, _d="IBAN")
customer_id = DataElementField(type='id', _d="Kunden-ID")
account_type = DataElementField(type='num', max_length=2, _d="Kontoart")
account_currency = DataElementField(type='cur', _d="Kontowährung")
name_account_owner_1 = DataElementField(type='an', max_length=27, _d="Name des Kontoinhabers 1")
name_account_owner_2 = DataElementField(type='an', max_length=27, required=False, _d="Name des Kontoinhabers 2")
account_product_name = DataElementField(type='an', max_length=30, required=False, _d="Kontoproduktbezeichnung")
account_limit = DataElementGroupField(type=AccountLimit, required=False, _d="Kontolimit")
allowed_transactions = DataElementGroupField(type=AllowedTransaction, count=999, required=False, _d="Erlaubte Geschäftsvorfälle")
extension = DataElementField(type='an', max_length=2048, required=False, _d="Erweiterung, kontobezogen")
class HKKOM4(FinTS3Segment):
"""Kommunikationszugang anfordern, version 4
Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Formals"""
start_bank_identifier = DataElementGroupField(type=BankIdentifier, required=False, _d="Von Kreditinstitutskennung")
end_bank_identifier = DataElementGroupField(type=BankIdentifier, required=False, _d="Bis Kreditinstitutskennung")
"""Kontoumsätze anfordern/Zeitraum, version 7
Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
account = DataElementGroupField(type=KTI1, _d="Kontoverbindung international")
all_accounts = DataElementField(type='jn', _d="Alle Konten")
date_start = DataElementField(type='dat', required=False, _d="Von Datum")
date_end = DataElementField(type='dat', required=False, _d="Bis Datum")
max_number_responses = DataElementField(type='num', max_length=4, required=False, _d="Maximale Anzahl Einträge")
touchdown_point = DataElementField(type='an', max_length=35, required=False, _d="Aufsetzpunkt")
class HIKAZ7(FinTS3Segment):
"""Kontoumsätze rückmelden/Zeitraum, version 7
Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
statement_booked = DataElementField(type='bin', _d="Gebuchte Umsätze")
statement_pending = DataElementField(type='bin', required=False, _d="Nicht gebuchte Umsätze")
class DKKKU2(FinTS3Segment):
"""Kreditkartenumsätze anfordern, version 2
Source: Reverse engineered"""
account = DataElementGroupField(type=Account2, _d="Kontoverbindung Auftraggeber")
credit_card_number = DataElementField(type='an', _d="Kreditkartennummer")
subaccount = DataElementField(type='an', required=False, _d="Subaccount?")
date_start = DataElementField(type='dat', required=False, _d="Von Datum")
date_end = DataElementField(type='dat', required=False, _d="Bis Datum")
max_number_responses = DataElementField(type='num', max_length=4, required=False, _d="Maximale Anzahl Einträge")
touchdown_point = DataElementField(type='an', max_length=35, required=False, _d="Aufsetzpunkt")
Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
account = DataElementGroupField(type=Account3, _d="Kontoverbindung Auftraggeber")
all_accounts = DataElementField(type='jn', _d="Alle Konten")
date_start = DataElementField(type='dat', required=False, _d="Von Datum")
date_end = DataElementField(type='dat', required=False, _d="Bis Datum")
max_number_responses = DataElementField(type='num', max_length=4, required=False, _d="Maximale Anzahl Einträge")
touchdown_point = DataElementField(type='an', max_length=35, required=False, _d="Aufsetzpunkt")
class HIKAZ6(FinTS3Segment):
"""Kontoumsätze rückmelden/Zeitraum, version 6
Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
statement_booked = DataElementField(type='bin', _d="Gebuchte Umsätze")
statement_pending = DataElementField(type='bin', required=False, _d="Nicht gebuchte Umsätze")
class HKKAZ7(FinTS3Segment):
"""Kontoumsätze anfordern/Zeitraum, version 7
Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
account = DataElementGroupField(type=KTI1, _d="Kontoverbindung international")
all_accounts = DataElementField(type='jn', _d="Alle Konten")
date_start = DataElementField(type='dat', required=False, _d="Von Datum")
date_end = DataElementField(type='dat', required=False, _d="Bis Datum")
max_number_responses = DataElementField(type='num', max_length=4, required=False, _d="Maximale Anzahl Einträge")
touchdown_point = DataElementField(type='an', max_length=35, required=False, _d="Aufsetzpunkt")
class HIKAZ7(FinTS3Segment):
"""Kontoumsätze rückmelden/Zeitraum, version 7
from fints.fields import DataElementField, DataElementGroupField
from fints.formals import KTI1, Account2, Account3, QueryCreditCardStatements2, SupportedMessageTypes, \
BookedCamtStatements1
from .base import FinTS3Segment, ParameterSegment
class HKKAZ5(FinTS3Segment):
"""Kontoumsätze anfordern/Zeitraum, version 5
Source: HBCI Homebanking-Computer-Interface, Schnittstellenspezifikation"""
account = DataElementGroupField(type=Account2, _d="Kontoverbindung Auftraggeber")
all_accounts = DataElementField(type='jn', _d="Alle Konten")
date_start = DataElementField(type='dat', required=False, _d="Von Datum")
date_end = DataElementField(type='dat', required=False, _d="Bis Datum")
max_number_responses = DataElementField(type='num', max_length=4, required=False, _d="Maximale Anzahl Einträge")
touchdown_point = DataElementField(type='an', max_length=35, required=False, _d="Aufsetzpunkt")
class HIKAZ5(FinTS3Segment):
"""Kontoumsätze rückmelden/Zeitraum, version 5
Source: HBCI Homebanking-Computer-Interface, Schnittstellenspezifikation"""
statement_booked = DataElementField(type='bin', _d="Gebuchte Umsätze")
statement_pending = DataElementField(type='bin', required=False, _d="Nicht gebuchte Umsätze")
class HKKAZ6(FinTS3Segment):
"""Kontoumsätze anfordern/Zeitraum, version 6
task_hash_value = DataElementField(type='bin', max_length=256, required=False, _d="Auftrags-Hashwert")
task_reference = DataElementField(type='an', max_length=35, required=False, _d="Auftragsreferenz")
tan_list_number = DataElementField(type='an', max_length=20, required=False, _d="TAN-Listennummer")
further_tan_follows = DataElementField(type='jn', length=1, required=False, _d="Weitere TAN folgt")
cancel_task = DataElementField(type='jn', length=1, required=False, _d="Auftrag stornieren")
challenge_class = DataElementField(type='num', max_length=2, required=False, _d="Challenge-Klasse")
parameter_challenge_class = DataElementGroupField(type=ParameterChallengeClass, required=False, _d="Parameter Challenge-Klasse")
tan_medium_name = DataElementField(type='an', max_length=32, required=False, _d="Bezeichnung des TAN-Mediums")
class HKTAN5(FinTS3Segment):
"""Zwei-Schritt-TAN-Einreichung, version 5
Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Sicherheitsverfahren PIN/TAN"""
tan_process = DataElementField(type='code', length=1, _d="TAN-Prozess")
segment_type = DataElementField(type='an', max_length=6, required=False, _d="Segmentkennung")
account = DataElementGroupField(type=KTI1, required=False, _d="Kontoverbindung international Auftraggeber")
task_hash_value = DataElementField(type='bin', max_length=256, required=False, _d="Auftrags-Hashwert")
task_reference = DataElementField(type='an', max_length=35, required=False, _d="Auftragsreferenz")
tan_list_number = DataElementField(type='an', max_length=20, required=False, _d="TAN-Listennummer")
further_tan_follows = DataElementField(type='jn', length=1, required=False, _d="Weitere TAN folgt")
cancel_task = DataElementField(type='jn', length=1, required=False, _d="Auftrag stornieren")
sms_charge_account = DataElementGroupField(type=KTI1, required=False, _d="SMS-Abbuchungskonto")
challenge_class = DataElementField(type='num', max_length=2, required=False, _d="Challenge-Klasse")
parameter_challenge_class = DataElementGroupField(type=ParameterChallengeClass, required=False, _d="Parameter Challenge-Klasse")
tan_medium_name = DataElementField(type='an', max_length=32, required=False, _d="Bezeichnung des TAN-Mediums")
class HKTAN6(FinTS3Segment):
"""Zwei-Schritt-TAN-Einreichung, version 6
Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Sicherheitsverfahren PIN/TAN"""
challenge_class = DataElementField(type='num', max_length=2, required=False, _d="Challenge-Klasse")
parameter_challenge_class = DataElementGroupField(type=ParameterChallengeClass, required=False, _d="Parameter Challenge-Klasse")
tan_medium_name = DataElementField(type='an', max_length=32, required=False, _d="Bezeichnung des TAN-Mediums")
class HKTAN5(FinTS3Segment):
"""Zwei-Schritt-TAN-Einreichung, version 5
Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Sicherheitsverfahren PIN/TAN"""
tan_process = DataElementField(type='code', length=1, _d="TAN-Prozess")
segment_type = DataElementField(type='an', max_length=6, required=False, _d="Segmentkennung")
account = DataElementGroupField(type=KTI1, required=False, _d="Kontoverbindung international Auftraggeber")
task_hash_value = DataElementField(type='bin', max_length=256, required=False, _d="Auftrags-Hashwert")
task_reference = DataElementField(type='an', max_length=35, required=False, _d="Auftragsreferenz")
tan_list_number = DataElementField(type='an', max_length=20, required=False, _d="TAN-Listennummer")
further_tan_follows = DataElementField(type='jn', length=1, required=False, _d="Weitere TAN folgt")
cancel_task = DataElementField(type='jn', length=1, required=False, _d="Auftrag stornieren")
sms_charge_account = DataElementGroupField(type=KTI1, required=False, _d="SMS-Abbuchungskonto")
challenge_class = DataElementField(type='num', max_length=2, required=False, _d="Challenge-Klasse")
parameter_challenge_class = DataElementGroupField(type=ParameterChallengeClass, required=False, _d="Parameter Challenge-Klasse")
tan_medium_name = DataElementField(type='an', max_length=32, required=False, _d="Bezeichnung des TAN-Mediums")
class HKTAN6(FinTS3Segment):
"""Zwei-Schritt-TAN-Einreichung, version 6
Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Sicherheitsverfahren PIN/TAN"""
tan_process = DataElementField(type='code', length=1, _d="TAN-Prozess")
segment_type = DataElementField(type='an', max_length=6, required=False, _d="Segmentkennung")
account = DataElementGroupField(type=KTI1, required=False, _d="Kontoverbindung international Auftraggeber")
task_hash_value = DataElementField(type='bin', max_length=256, required=False, _d="Auftrags-Hashwert")
task_reference = DataElementField(type='an', max_length=35, required=False, _d="Auftragsreferenz")