Fixed that GetUserTanProceduresResponse isn't required anymore

This commit is contained in:
dankito 2020-08-12 15:13:43 +02:00
parent 7649df6a6b
commit 3160ebaa2c
2 changed files with 1 additions and 28 deletions

View File

@ -12,7 +12,6 @@ import net.dankito.banking.fints.messages.datenelemente.implementierte.signatur.
import net.dankito.banking.fints.messages.datenelemente.implementierte.tan.*
import net.dankito.banking.fints.messages.segmente.id.CustomerSegmentId
import net.dankito.banking.fints.model.*
import net.dankito.banking.fints.response.GetUserTanProceduresResponse
import net.dankito.banking.fints.response.InstituteSegmentId
import net.dankito.banking.fints.response.Response
import net.dankito.banking.fints.response.ResponseParser
@ -567,9 +566,7 @@ open class FinTsClient(
val message = messageBuilder.createInitDialogMessage(dialogContext)
getAndHandleResponseForMessage(message, dialogContext) { unmappedResponse ->
val response = GetUserTanProceduresResponse(unmappedResponse)
dialogContext.response = response
getAndHandleResponseForMessage(message, dialogContext) { response ->
if (response.successful) {
updateBankData(dialogContext.bank, response)

View File

@ -1,24 +0,0 @@
package net.dankito.banking.fints.response
open class GetUserTanProceduresResponse(bankResponse: Response)
: Response(bankResponse.didReceiveResponse, bankResponse.receivedResponse, bankResponse.receivedSegments,
bankResponse.exception, bankResponse.noTanProcedureSelected, bankResponse.messageCreationError) {
/**
* comdirect sends "9955::Unzulässiges TAN-Verfahren." even though '999' is a valid TAN procedure
* for init dialog if user's TAN procedures are not known yet
* -> check if the only error is '9955', then it's still a success.
*/
override val successful: Boolean
get() = noTanProcedureSelected == false && couldCreateMessage && didReceiveResponse
&& tanRequiredButUserDidNotEnterOne == false
&& (responseContainsErrors == false || containsOnlyInvalidTanProcedureError())
protected open fun containsOnlyInvalidTanProcedureError(): Boolean {
val errorFeedbacks = segmentFeedbacks.flatMap { it.feedbacks }.filter { it.isError }
return errorFeedbacks.size == 1 && errorFeedbacks.first().responseCode == 9955
}
}