From: Henryk Plötz Date: Sat, 8 Jun 2019 18:18:29 +0000 (+0200) Subject: Make get_information() return the supported SEPA versions X-Git-Tag: v2.2.0~9^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ea07d15bcf6f5593284742464dbf61cc139655b;p=thirdparty%2Fpython-fints.git Make get_information() return the supported SEPA versions --- diff --git a/fints/client.py b/fints/client.py index c5a7d72..5814491 100644 --- a/fints/client.py +++ b/fints/client.py @@ -350,6 +350,8 @@ class FinTS3Client: bank: name: Bank Name supported_operations: dict(FinTSOperations -> boolean) + supported_formats: dict(FinTSOperation -> ['urn:iso:std:iso:20022:tech:xsd:pain.001.003.03', ...]) + supported_sepa_formats: ['urn:iso:std:iso:20022:tech:xsd:pain.001.003.03', ...] accounts: - iban: IBAN account_number: Account Number @@ -376,6 +378,15 @@ class FinTS3Client: op: any(self.bpd.find_segment_first(cmd[0]+'I'+cmd[2:]+'S') for cmd in op.value) for op in FinTSOperations } + retval['bank']['supported_formats'] = {} + for op in FinTSOperations: + for segment in (self.bpd.find_segment_first(cmd[0] + 'I' + cmd[2:] + 'S') for cmd in op.value): + if not hasattr(segment, 'parameter'): + continue + formats = getattr(segment.parameter, 'supported_sepa_formats', []) + retval['bank']['supported_formats'][op] = list( + set(retval['bank']['supported_formats'].get(op, [])).union(set(formats)) + ) hispas = self.bpd.find_segment_first('HISPAS') if hispas: retval['bank']['supported_sepa_formats'] = list(hispas.parameter.supported_sepa_formats)