From 4014b9281028ff4509b5b5f43d0e5336ea976458 Mon Sep 17 00:00:00 2001 From: dankito Date: Sat, 16 May 2020 19:32:46 +0200 Subject: [PATCH] Implemented that close dialog responses don't get parsed --- .../main/kotlin/net/dankito/fints/FinTsClient.kt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt b/fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt index 49331456..d8f8980e 100644 --- a/fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt +++ b/fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt @@ -108,7 +108,7 @@ open class FinTsClient @JvmOverloads constructor( val dialogEndRequestBody = messageBuilder.createAnonymousDialogEndMessage(dialogContext) - getAndHandleResponseForMessage(dialogEndRequestBody, dialogContext) // TODO: really handle close dialog response? + fireAndForgetMessage(dialogEndRequestBody, dialogContext) } @@ -501,7 +501,7 @@ open class FinTsClient @JvmOverloads constructor( val dialogEndRequestBody = messageBuilder.createDialogEndMessage(dialogContext) - getAndHandleResponseForMessage(dialogEndRequestBody, dialogContext) // TODO: really handle close dialog response? + fireAndForgetMessage(dialogEndRequestBody, dialogContext) } @@ -591,6 +591,16 @@ open class FinTsClient @JvmOverloads constructor( ) } + protected open fun fireAndForgetMessage(message: MessageBuilderResult, dialogContext: DialogContext) { + message.createdMessage?.let { requestBody -> + addMessageLog(requestBody, MessageLogEntryType.Sent, dialogContext) + + getResponseForMessage(requestBody, dialogContext.bank.finTs3ServerAddress) + + // if really needed add received response to message log here + } + } + protected open fun handleResponse(webResponse: WebClientResponse, dialogContext: DialogContext): Response { val responseBody = webResponse.body