From e619c1fafd46f553bcc1790c61a4f7891a3c9693 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Sun, 22 Dec 2019 18:20:26 +0100 Subject: [PATCH] Implement get_balance for PSD2 --- fints/client.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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): """ -- 2.47.2