from .formals import (
CUSTOMER_ID_ANONYMOUS, KTI1, BankIdentifier, DescriptionRequired,
SynchronizationMode, TANMediaClass4, TANMediaType2,
- SupportedMessageTypes)
+ SupportedMessageTypes, TANUsageOption
+)
from .message import FinTSInstituteMessage
from .models import SEPAAccount
from .parser import FinTS3Serializer
context = self._get_dialog()
method = lambda dialog: dialog.send
-
with context as dialog:
+ if isinstance(self.init_tan_response, NeedTANResponse):
+ # This is a workaround for when the dialog already contains return code 3955.
+ # This occurs with e.g. Sparkasse Heidelberg, which apparently does not require us to choose a
+ # medium for pushTAN but is totally fine with keeping "" as a TAN medium.
+ return TANUsageOption.ALL_ACTIVE, []
+
hktab = self._find_highest_supported_command(HKTAB4, HKTAB5)
seg = hktab(
m = client.get_tan_media()
if len(m[1]) == 1:
client.set_tan_medium(m[1][0])
+ elif len(m[1]) == 0:
+ # This is a workaround for when the dialog already contains return code 3955.
+ # This occurs with e.g. Sparkasse Heidelberg, which apparently does not require us to choose a
+ # medium for pushTAN but is totally fine with keeping "" as a TAN medium.
+ client.selected_tan_medium = ""
else:
print("Multiple tan media available. Which one do you prefer?")
for i, mm in enumerate(m[1]):