Renamed messageCreationError to messageThatCouldNotBeCreated

This commit is contained in:
dankito 2021-11-01 16:15:00 +01:00
parent b0af1cd1c9
commit bb520de5d5
4 changed files with 11 additions and 8 deletions

View File

@ -46,7 +46,9 @@ open class RequestExecutor(
open fun getAndHandleResponseForMessage(message: MessageBuilderResult, dialogContext: DialogContext, open fun getAndHandleResponseForMessage(message: MessageBuilderResult, dialogContext: DialogContext,
tanRequiredCallback: (TanResponse, BankResponse, callback: (BankResponse) -> Unit) -> Unit, callback: (BankResponse) -> Unit) { tanRequiredCallback: (TanResponse, BankResponse, callback: (BankResponse) -> Unit) -> Unit, callback: (BankResponse) -> Unit) {
if (message.createdMessage == null) { 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 { else {
getAndHandleResponseForMessage(message.createdMessage, dialogContext) { response -> getAndHandleResponseForMessage(message.createdMessage, dialogContext) { response ->

View File

@ -18,11 +18,11 @@ open class BankResponse(
*/ */
val errorMessage: String? = null, val errorMessage: String? = null,
val noTanMethodSelected: Boolean = false, val noTanMethodSelected: Boolean = false,
val messageCreationError: MessageBuilderResult? = null val messageThatCouldNotBeCreated: MessageBuilderResult? = null // i think that can be removed
) { ) {
open val couldCreateMessage: Boolean open val couldCreateMessage: Boolean
get() = messageCreationError == null get() = messageThatCouldNotBeCreated == null
open val responseContainsErrors: Boolean open val responseContainsErrors: Boolean
get() = errorMessage == null && get() = errorMessage == null &&

View File

@ -26,6 +26,7 @@ open class FinTsClientResponse(
open val tanRequiredButWeWereToldToAbortIfSo: Boolean = false, open val tanRequiredButWeWereToldToAbortIfSo: Boolean = false,
// i think they can be removed
open val isJobAllowed: Boolean = true, open val isJobAllowed: Boolean = true,
open val isJobVersionSupported: Boolean = true, open val isJobVersionSupported: Boolean = true,
open val allowedVersions: List<Int> = listOf(), open val allowedVersions: List<Int> = listOf(),
@ -37,10 +38,10 @@ open class FinTsClientResponse(
response.isStrongAuthenticationRequired, response.tanResponse, response.errorsToShowToUser, response.isStrongAuthenticationRequired, response.tanResponse, response.errorsToShowToUser,
response.errorMessage, response.wrongCredentialsEntered, response.errorMessage, response.wrongCredentialsEntered,
response.tanRequiredButUserDidNotEnterOne, response.tanRequiredButWeWereToldToAbortIfSo, response.tanRequiredButUserDidNotEnterOne, response.tanRequiredButWeWereToldToAbortIfSo,
response.messageCreationError?.isJobAllowed ?: true, response.messageThatCouldNotBeCreated?.isJobAllowed ?: true,
response.messageCreationError?.isJobVersionSupported ?: true, response.messageThatCouldNotBeCreated?.isJobVersionSupported ?: true,
response.messageCreationError?.allowedVersions ?: listOf(), response.messageThatCouldNotBeCreated?.allowedVersions ?: listOf(),
response.messageCreationError?.supportedVersions ?: listOf()) response.messageThatCouldNotBeCreated?.supportedVersions ?: listOf())
override fun toString(): String { override fun toString(): String {

View File

@ -6,7 +6,7 @@ import net.dankito.banking.fints.response.ResponseParser
open class GetUserTanMethodsResponse(bankResponse: BankResponse) open class GetUserTanMethodsResponse(bankResponse: BankResponse)
: BankResponse(bankResponse.didReceiveResponse, bankResponse.receivedResponse, bankResponse.receivedSegments, : 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 * comdirect sends "9955::Unzulässiges TAN-Verfahren." even though '999' is a valid TAN method