From 16284e5782786fcf761c8c659e7267207485c5cc Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 8 Jun 2020 23:40:29 +0200 Subject: [PATCH] Removed useStrongAuthentication from createInitDialogMessage() as this value can be determined by if user's TAN procedure is selected or not --- .../kotlin/net/dankito/banking/fints/FinTsClient.kt | 9 ++++----- .../net/dankito/banking/fints/messages/MessageBuilder.kt | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt index 1af55a4d..cb030b3f 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt @@ -128,7 +128,7 @@ open class FinTsClient( val dialogContext = DialogContext(bank, customer, product) - val initDialogResponse = initDialogAfterSuccessfulChecks(dialogContext, false) + val initDialogResponse = initDialogAfterSuccessfulChecks(dialogContext) closeDialog(dialogContext) // TODO: only close dialog if a) bank didn't close it already and b) if a global flag is set to close dialog as actually it's not necessary @@ -455,13 +455,12 @@ open class FinTsClient( return tanProcedureSelectedResponse } - return initDialogAfterSuccessfulChecks(dialogContext, true) + return initDialogAfterSuccessfulChecks(dialogContext) } - protected open fun initDialogAfterSuccessfulChecks(dialogContext: DialogContext, - useStrongAuthentication: Boolean = true): Response { + protected open fun initDialogAfterSuccessfulChecks(dialogContext: DialogContext): Response { - val message = messageBuilder.createInitDialogMessage(dialogContext, useStrongAuthentication) + val message = messageBuilder.createInitDialogMessage(dialogContext) val response = GetUserTanProceduresResponse(getAndHandleResponseForMessage(message, dialogContext)) dialogContext.response = response diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/messages/MessageBuilder.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/messages/MessageBuilder.kt index 3898f9db..7f20a27a 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/messages/MessageBuilder.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/messages/MessageBuilder.kt @@ -65,14 +65,14 @@ open class MessageBuilder(protected val generator: ISegmentNumberGenerator = Seg } - open fun createInitDialogMessage(dialogContext: DialogContext, useStrongAuthentication: Boolean = true): MessageBuilderResult { + open fun createInitDialogMessage(dialogContext: DialogContext): MessageBuilderResult { val segments = mutableListOf( IdentifikationsSegment(generator.resetSegmentNumber(2), dialogContext), Verarbeitungsvorbereitung(generator.getNextSegmentNumber(), dialogContext) ) - if (useStrongAuthentication) { + if (dialogContext.customer.isTanProcedureSelected) { segments.add(ZweiSchrittTanEinreichung(generator.getNextSegmentNumber(), TanProcess.TanProcess4, CustomerSegmentId.Identification)) }