How to use the fints.formals.DataElementGroup function in fints

To help you get started, we’ve selected a few fints examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github raphaelm / python-fints / fints / formals.py View on Github external
certificate_content = DataElementField(type='bin', max_length=4096)


class UserDefinedSignature(DataElementGroup):
    pin = PasswordField(max_length=99)
    tan = DataElementField(type='an', max_length=99, required=False)


class Response(DataElementGroup):
    code = DataElementField(type='dig', length=4)
    reference_element = DataElementField(type='an', max_length=7)
    text = DataElementField(type='an', max_length=80)
    parameters = DataElementField(type='an', max_length=35, max_count=10, required=False)


class Amount1(DataElementGroup):
    """Betrag

    Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
    amount = DataElementField(type='wrt', _d="Wert")
    currency = DataElementField(type='cur', _d="Währung")


class AccountInformation(DataElementGroup):
    account_number = DataElementField(type='id')
    subaccount_number = DataElementField(type='id')
    bank_identifier = DataElementGroupField(type=BankIdentifier)


class AccountLimit(DataElementGroup):
    limit_type = DataElementField(type='code', length=1)
    limit_amount = DataElementGroupField(type=Amount1, required=False)
github raphaelm / python-fints / fints / formals.py View on Github external
    @classmethod
    def from_sepa_account(cls, acc):
        return cls(
            is_sepa=True,
            iban=acc.iban,
            bic=acc.bic,
            account_number=acc.accountnumber,
            subaccount_number=acc.subaccount,
            bank_identifier=BankIdentifier(
                country_identifier=BankIdentifier.COUNTRY_ALPHA_TO_NUMERIC[acc.bic[4:6]],
                bank_code=acc.blz
            )
        )


class KTI1(DataElementGroup):
    """Kontoverbindung international, version 1

    Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
    iban = DataElementField(type='an', max_length=34, required=False, _d="IBAN")
    bic = DataElementField(type='an', max_length=11, required=False, _d="BIC")
    account_number = DataElementField(type='id', required=False, _d="Konto-/Depotnummer")
    subaccount_number = DataElementField(type='id', required=False, _d="Unterkontomerkmal")
    bank_identifier = DataElementGroupField(type=BankIdentifier, required=False, _d="Kreditinstitutskennung")

    @classmethod
    def from_sepa_account(cls, acc):
        return cls(
            iban=acc.iban,
            bic=acc.bic,
        )
github raphaelm / python-fints / fints / formals.py View on Github external
card_sequence = DataElementField(type='id', required=False, _d="Kartenfolgenummer")
    card_type = DataElementField(type='num', required=False, _d="Kartenart")
    account = DataElementGroupField(type=Account3, required=False, _d="Kontonummer Auftraggeber")
    valid_from = DataElementField(type='dat', required=False, _d="Gültig ab")
    valid_until = DataElementField(type='dat', required=False, _d="Gültig bis")
    tan_list_number = DataElementField(type='an', max_length=20, required=False, _d="TAN-Listennummer")
    tan_medium_name = DataElementField(type='an', max_length=32, required=False, _d="Bezeichnung des TAN-Mediums")
    mobile_number_masked = DataElementField(type='an', max_length=35, required=False, _d="Mobiltelefonnummer, verschleiert")
    mobile_number = DataElementField(type='an', max_length=35, required=False, _d="Mobiltelefonnummer")
    sms_charge_account = DataElementGroupField(type=KTI1, required=False, _d="SMS-Abbuchungskonto")
    number_free_tans = DataElementField(type='num', max_length=3, required=False, _d="Anzahl freie TANs")
    last_use = DataElementField(type='dat', required=False, _d="Letzte Benutzung")
    active_since = DataElementField(type='dat', required=False, _d="Freigeschaltet am")


class TANMedia5(DataElementGroup):
    """TAN-Medium-Liste, version 5

    Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Sicherheitsverfahren PIN/TAN"""

    tan_medium_class = CodeField(enum=TANMediaClass4, _d="TAN-Medium-Klasse")
    status = CodeField(enum=TANMediumStatus, _d="Status")
    security_function = DataElementField(type='num', required=False, _d="Sicherheitsfunktion, kodiert")
    card_number = DataElementField(type='id', required=False, _d="Kartennummer")
    card_sequence = DataElementField(type='id', required=False, _d="Kartenfolgenummer")
    card_type = DataElementField(type='num', required=False, _d="Kartenart")
    account = DataElementGroupField(type=Account3, required=False, _d="Kontonummer Auftraggeber")
    valid_from = DataElementField(type='dat', required=False, _d="Gültig ab")
    valid_until = DataElementField(type='dat', required=False, _d="Gültig bis")
    tan_list_number = DataElementField(type='an', max_length=20, required=False, _d="TAN-Listennummer")
    tan_medium_name = DataElementField(type='an', max_length=32, required=False, _d="Bezeichnung des TAN-Mediums")
    mobile_number_masked = DataElementField(type='an', max_length=35, required=False, _d="Mobiltelefonnummer, verschleiert")
github raphaelm / python-fints / fints / formals.py View on Github external
RDH = 'RDH'
    PIN = 'PIN'


class SecurityProfile(DataElementGroup):
    """Sicherheitsprofil"""
    security_method = CodeField(enum=SecurityMethod, length=3, _d="Sicherheitsverfahren")
    security_method_version = DataElementField(type='num', _d="Version des Sicherheitsverfahrens")


class IdentifiedRole(RepresentableEnum):
    MS = '1' #: Message Sender
    MR = '2' #: Message Receiver


class SecurityIdentificationDetails(DataElementGroup):
    identified_role = CodeField(IdentifiedRole, max_length=3)
    cid = DataElementField(type='bin', max_length=256)
    identifier = DataElementField(type='id')


class DateTimeType(RepresentableEnum):
    STS = '1'  #: Sicherheitszeitstempel
    CRT = '6'  #: Certificate Revocation Time


class SecurityDateTime(DataElementGroup):
    date_time_type = CodeField(DateTimeType, max_length=3)
    date = DataElementField(type='dat', required=False)
    time = DataElementField(type='tim', required=False)
github raphaelm / python-fints / fints / formals.py View on Github external
Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
    max_number_responses_allowed = DataElementField(type='jn', _d="Eingabe Anzahl Einträge erlaubt")
    date_range_allowed = DataElementField(type='jn', _d="Zeitraum möglich")
    supported_sepa_formats = DataElementField(type='an', max_length=256, max_count=9, required=False, _d="Unterstützte SEPA-Datenformate")


class QueryScheduledBatchDebitParameter1(DataElementGroup):
    """Parameter Bestand terminierter SEPA-Sammellastschriften, version 1

    Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
    max_number_responses_allowed = DataElementField(type='jn', _d="Eingabe Anzahl Einträge erlaubt")
    date_range_allowed = DataElementField(type='jn', _d="Zeitraum möglich")


class QueryCreditCardStatements2(DataElementGroup):
    """Parameter Kreditkartenumsätze anfordern, version 2

    Source: reverse engineered"""
    cutoff_days = DataElementField(type='num', max_length=4, _d="Maximale Vorhaltezeit der Umsätze")
    max_number_responses_allowed = DataElementField(type='jn', _d="Eingabe Anzahl Einträge erlaubt")
    date_range_allowed = DataElementField(type='jn', _d="Zeitraum möglich")


class SEPACCode1(RepresentableEnum):
    REVERSAL = '1'  #: Reversal
    REVOCATION = '2'  #: Revocation
    DELETION = '3'  #: Delete


class StatusSEPATask1(RepresentableEnum):
    PENDING = '1'  #: In Terminierung
github raphaelm / python-fints / fints / formals.py View on Github external
Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Formals"""
    NEW_SYSTEM_ID = '0'  #: Neue Kundensystem-ID zurückmelden
    LAST_MESSAGE = '1'  #: Letzte verarbeitete Nachrichtennummer zurückmelden
    SIGNATURE_ID = '2'  #: Signatur-ID zurückmelden


class CreditDebit2(RepresentableEnum):
    """Soll-Haben-Kennzeichen, version 2

    Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
    CREDIT = 'C'  #: Haben
    DEBIT = 'D'  #: Soll


class Balance1(DataElementGroup):
    """Saldo, version 1

    Source: HBCI Homebanking-Computer-Interface, Schnittstellenspezifikation"""
    credit_debit = CodeField(enum=CreditDebit2, length=1, _d="Soll-Haben-Kennzeichen")
    amount = DataElementField(type='wrt', _d="Wert")
    currency = DataElementField(type='cur', _d="Währung")
    date = DataElementField(type='dat', _d="Datum")
    time = DataElementField(type='tim', required=False, _d="Uhrzeit")

    def as_mt940_Balance(self):
        from mt940.models import Balance
        return Balance(
            self.credit_debit.value,
            "{:.12f}".format(self.amount).rstrip('0'),
            self.date,
            currency=self.currency
github raphaelm / python-fints / fints / formals.py View on Github external
CUSTOMER_ID_ANONYMOUS = '9999999999'


class DataElementGroup(Container):
    pass


class SegmentHeader(ShortReprMixin, DataElementGroup):
    """Segmentkopf"""
    type = AlphanumericField(max_length=6, _d='Segmentkennung')
    number = NumericField(max_length=3, _d='Segmentnummer')
    version = NumericField(max_length=3, _d='Segmentversion')
    reference = NumericField(max_length=3, required=False, _d='Bezugssegment')


class ReferenceMessage(DataElementGroup):
    dialog_id = DataElementField(type='id')
    message_number = NumericField(max_length=4)


class SecurityMethod(RepresentableEnum):
    DDV = 'DDV'
    RAH = 'RAH'
    RDH = 'RDH'
    PIN = 'PIN'


class SecurityProfile(DataElementGroup):
    """Sicherheitsprofil"""
    security_method = CodeField(enum=SecurityMethod, length=3, _d="Sicherheitsverfahren")
    security_method_version = DataElementField(type='num', _d="Version des Sicherheitsverfahrens")
github raphaelm / python-fints / fints / formals.py View on Github external
class SupportedSEPAPainMessages1(DataElementGroup):
    """Unterstützte SEPA pain messages, version 1

    Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
    sepa_descriptors = DataElementField(type='an', max_length=256, max_count=99, _d="SEPA Descriptor")


class QueryScheduledDebitParameter1(DataElementGroup):
    """Parameter Bestand terminierter SEPA-Einzellastschriften, version 1

    Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
    date_range_allowed = DataElementField(type='jn', _d="Zeitraum möglich")
    max_number_responses_allowed = DataElementField(type='jn', _d="Eingabe Anzahl Einträge erlaubt")


class QueryScheduledDebitParameter2(DataElementGroup):
    """Parameter Bestand terminierter SEPA-Einzellastschriften, version 2

    Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
    max_number_responses_allowed = DataElementField(type='jn', _d="Eingabe Anzahl Einträge erlaubt")
    date_range_allowed = DataElementField(type='jn', _d="Zeitraum möglich")
    supported_sepa_formats = DataElementField(type='an', max_length=256, max_count=9, required=False, _d="Unterstützte SEPA-Datenformate")


class QueryScheduledBatchDebitParameter1(DataElementGroup):
    """Parameter Bestand terminierter SEPA-Sammellastschriften, version 1

    Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
    max_number_responses_allowed = DataElementField(type='jn', _d="Eingabe Anzahl Einträge erlaubt")
    date_range_allowed = DataElementField(type='jn', _d="Zeitraum möglich")
github raphaelm / python-fints / fints / formals.py View on Github external
class Language2(RepresentableEnum):
    """Dialogsprache

    Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Formals"""
    DEFAULT = '0'  #: Standard
    DE = '1'  #: Deutsch, 'de', Subset Deutsch, Codeset 1 (Latin 1)
    EN = '2'  #: Englisch, 'en', Subset Englisch, Codeset 1 (Latin 1)
    FR = '3'  #: Französisch, 'fr', Subset Französisch, Codeset 1 (Latin 1)


class SupportedLanguages2(DataElementGroup):
    languages = CodeField(enum=Language2, max_length=3, min_count=1, max_count=9)


class SupportedHBCIVersions2(DataElementGroup):
    versions = DataElementField(type='code', max_length=3, min_count=1, max_count=9)


class KTZ1(DataElementGroup):
    """Kontoverbindung ZV international, version 1

    Source: FinTS Financial Transaction Services, Schnittstellenspezifikation, Messages -- Multibankfähige Geschäftsvorfälle """
    is_sepa = DataElementField(type='jn', _d="Kontoverwendung SEPA")
    iban = DataElementField(type='an', max_length=34, _d="IBAN")
    bic = DataElementField(type='an', max_length=11, _d="BIC")
    account_number = DataElementField(type='id', _d="Konto-/Depotnummer")
    subaccount_number = DataElementField(type='id', _d="Unterkontomerkmal")
    bank_identifier = DataElementGroupField(type=BankIdentifier, _d="Kreditinstitutskennung")

    def as_sepa_account(self):
        from fints.models import SEPAAccount
github raphaelm / python-fints / fints / formals.py View on Github external
MAY = '1'  #: SMS-Abbuchungskonto kann angegeben werden
    MUST = '2'  #: SMS-Abbuchungskonto muss angegeben werden


class PrincipalAccountRequired(RepresentableEnum):
    MUST_NOT = '0'  #: Auftraggeberkonto darf nicht angegeben werden
    MUST = '2'  #: Auftraggeberkonto muss angegeben werden, wenn im Geschäftsvorfall enthalten


class TaskHashAlgorithm(RepresentableEnum):
    NONE = '0'  #: Auftrags-Hashwert nicht unterstützt
    RIPEMD_160 = '1'  #: RIPEMD-160
    SHA_1 = '2'  #: SHA-1


class TwoStepParametersCommon(DataElementGroup):
    @property
    def VERSION(self):
        """TAN mechanism version"""
        return int(re.match(r'^(\D+)(\d+)$', self.__class__.__name__).group(2))

    security_function = DataElementField(type='code', max_length=3, _d="Sicherheitsfunktion kodiert")
    tan_process = DataElementField(type='code', length=1, _d="TAN-Prozess")
    tech_id = DataElementField(type='id', _d="Technische Identifikation TAN-Verfahren")


class TwoStepParameters1(TwoStepParametersCommon):
    name = DataElementField(type='an', max_length=30, _d="Name des Zwei-Schritt-Verfahrens")
    max_length_input = DataElementField(type='num', max_length=2, _d="Maximale Länge des Eingabewertes im Zwei-Schritt-Verfahren")
    allowed_format = CodeField(enum=AllowedFormat, length=1, _d="Erlaubtes Format im Zwei-Schritt-Verfahren")
    text_return_value = DataElementField(type='an', max_length=30, _d="Text zur Belegung des Rückgabewertes im Zwei-Schritt-Verfahren")
    max_length_return_value = DataElementField(type='num', max_length=3, _d="Maximale Länge des Rückgabewertes im Zwei-Schritt-Verfahren")