From: Raphael Michel Date: Sun, 22 Dec 2019 17:20:26 +0000 (+0100) Subject: Implement get_balance for PSD2 X-Git-Tag: v3.0.0~2^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e619c1fafd46f553bcc1790c61a4f7891a3c9693;p=thirdparty%2Fpython-fints.git Implement get_balance for PSD2 --- diff --git a/fints/client.py b/fints/client.py index d8a5232..bd513af 100644 --- a/fints/client.py +++ b/fints/client.py @@ -603,6 +603,10 @@ class FinTS3Client: return responses + def _get_balance(self, command_seg, response): + for resp in response.response_segments(command_seg, 'HISAL'): + return resp.balance_booked.as_mt940_Balance() + def get_balance(self, account: SEPAAccount): """ Fetches an accounts current balance. @@ -619,10 +623,8 @@ class FinTS3Client: all_accounts=False, ) - response = dialog.send(seg) - - for resp in response.response_segments(seg, 'HISAL'): - return resp.balance_booked.as_mt940_Balance() + response = self._send_with_possible_retry(dialog, seg, self._get_balance) + return response def get_holdings(self, account: SEPAAccount): """