Removed useStrongAuthentication from createInitDialogMessage() as this value can be determined by if user's TAN procedure is selected or not

This commit is contained in:
dankito 2020-06-08 23:40:29 +02:00
parent 2f4bac9fbf
commit 16284e5782
2 changed files with 6 additions and 7 deletions

View File

@ -128,7 +128,7 @@ open class FinTsClient(
val dialogContext = DialogContext(bank, customer, product) 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 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 tanProcedureSelectedResponse
} }
return initDialogAfterSuccessfulChecks(dialogContext, true) return initDialogAfterSuccessfulChecks(dialogContext)
} }
protected open fun initDialogAfterSuccessfulChecks(dialogContext: DialogContext, protected open fun initDialogAfterSuccessfulChecks(dialogContext: DialogContext): Response {
useStrongAuthentication: Boolean = true): Response {
val message = messageBuilder.createInitDialogMessage(dialogContext, useStrongAuthentication) val message = messageBuilder.createInitDialogMessage(dialogContext)
val response = GetUserTanProceduresResponse(getAndHandleResponseForMessage(message, dialogContext)) val response = GetUserTanProceduresResponse(getAndHandleResponseForMessage(message, dialogContext))
dialogContext.response = response dialogContext.response = response

View File

@ -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( val segments = mutableListOf(
IdentifikationsSegment(generator.resetSegmentNumber(2), dialogContext), IdentifikationsSegment(generator.resetSegmentNumber(2), dialogContext),
Verarbeitungsvorbereitung(generator.getNextSegmentNumber(), dialogContext) Verarbeitungsvorbereitung(generator.getNextSegmentNumber(), dialogContext)
) )
if (useStrongAuthentication) { if (dialogContext.customer.isTanProcedureSelected) {
segments.add(ZweiSchrittTanEinreichung(generator.getNextSegmentNumber(), TanProcess.TanProcess4, CustomerSegmentId.Identification)) segments.add(ZweiSchrittTanEinreichung(generator.getNextSegmentNumber(), TanProcess.TanProcess4, CustomerSegmentId.Identification))
} }