Renamed messageCreationError to messageThatCouldNotBeCreated
This commit is contained in:
parent
b0af1cd1c9
commit
bb520de5d5
|
@ -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 ->
|
||||
|
|
|
@ -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 &&
|
||||
|
|
|
@ -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<Int> = 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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue