diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/RequestExecutor.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/RequestExecutor.kt index 68924c52..2b335b0e 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/RequestExecutor.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/RequestExecutor.kt @@ -46,7 +46,9 @@ open class RequestExecutor( open fun getAndHandleResponseForMessage(message: MessageBuilderResult, dialogContext: DialogContext, tanRequiredCallback: (TanResponse, BankResponse, callback: (BankResponse) -> Unit) -> Unit, callback: (BankResponse) -> Unit) { if (message.createdMessage == null) { - callback(BankResponse(false, messageCreationError = message, errorMessage = "Could not create FinTS message to be sent to bank")) // TODO: translate + log.error("Could not create FinTS message to be sent to bank. isJobAllowed ${message.isJobAllowed}, isJobVersionSupported = ${message.isJobVersionSupported}," + + "allowedVersions = ${message.allowedVersions}, supportedVersions = ${message.supportedVersions}.") + callback(BankResponse(false, messageThatCouldNotBeCreated = message, errorMessage = "Could not create FinTS message to be sent to bank")) // TODO: translate } else { getAndHandleResponseForMessage(message.createdMessage, dialogContext) { response -> diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/BankResponse.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/BankResponse.kt index 8788fda2..38288327 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/BankResponse.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/BankResponse.kt @@ -18,11 +18,11 @@ open class BankResponse( */ val errorMessage: String? = null, val noTanMethodSelected: Boolean = false, - val messageCreationError: MessageBuilderResult? = null + val messageThatCouldNotBeCreated: MessageBuilderResult? = null // i think that can be removed ) { open val couldCreateMessage: Boolean - get() = messageCreationError == null + get() = messageThatCouldNotBeCreated == null open val responseContainsErrors: Boolean get() = errorMessage == null && diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/FinTsClientResponse.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/FinTsClientResponse.kt index 81def99b..1c4fcab3 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/FinTsClientResponse.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/FinTsClientResponse.kt @@ -26,6 +26,7 @@ open class FinTsClientResponse( open val tanRequiredButWeWereToldToAbortIfSo: Boolean = false, + // i think they can be removed open val isJobAllowed: Boolean = true, open val isJobVersionSupported: Boolean = true, open val allowedVersions: List = listOf(), @@ -37,10 +38,10 @@ open class FinTsClientResponse( response.isStrongAuthenticationRequired, response.tanResponse, response.errorsToShowToUser, response.errorMessage, response.wrongCredentialsEntered, response.tanRequiredButUserDidNotEnterOne, response.tanRequiredButWeWereToldToAbortIfSo, - response.messageCreationError?.isJobAllowed ?: true, - response.messageCreationError?.isJobVersionSupported ?: true, - response.messageCreationError?.allowedVersions ?: listOf(), - response.messageCreationError?.supportedVersions ?: listOf()) + response.messageThatCouldNotBeCreated?.isJobAllowed ?: true, + response.messageThatCouldNotBeCreated?.isJobVersionSupported ?: true, + response.messageThatCouldNotBeCreated?.allowedVersions ?: listOf(), + response.messageThatCouldNotBeCreated?.supportedVersions ?: listOf()) override fun toString(): String { diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/GetUserTanMethodsResponse.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/GetUserTanMethodsResponse.kt index a63ab0f1..7ecd6c62 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/GetUserTanMethodsResponse.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/client/GetUserTanMethodsResponse.kt @@ -6,7 +6,7 @@ import net.dankito.banking.fints.response.ResponseParser open class GetUserTanMethodsResponse(bankResponse: BankResponse) : BankResponse(bankResponse.didReceiveResponse, bankResponse.receivedResponse, bankResponse.receivedSegments, - bankResponse.errorMessage, bankResponse.noTanMethodSelected, bankResponse.messageCreationError) { + bankResponse.errorMessage, bankResponse.noTanMethodSelected, bankResponse.messageThatCouldNotBeCreated) { /** * comdirect sends "9955::Unzulässiges TAN-Verfahren." even though '999' is a valid TAN method