Fixed that GetUserTanProceduresResponse isn't required anymore
This commit is contained in:
parent
7649df6a6b
commit
3160ebaa2c
|
@ -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.datenelemente.implementierte.tan.*
|
||||||
import net.dankito.banking.fints.messages.segmente.id.CustomerSegmentId
|
import net.dankito.banking.fints.messages.segmente.id.CustomerSegmentId
|
||||||
import net.dankito.banking.fints.model.*
|
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.InstituteSegmentId
|
||||||
import net.dankito.banking.fints.response.Response
|
import net.dankito.banking.fints.response.Response
|
||||||
import net.dankito.banking.fints.response.ResponseParser
|
import net.dankito.banking.fints.response.ResponseParser
|
||||||
|
@ -567,9 +566,7 @@ open class FinTsClient(
|
||||||
|
|
||||||
val message = messageBuilder.createInitDialogMessage(dialogContext)
|
val message = messageBuilder.createInitDialogMessage(dialogContext)
|
||||||
|
|
||||||
getAndHandleResponseForMessage(message, dialogContext) { unmappedResponse ->
|
getAndHandleResponseForMessage(message, dialogContext) { response ->
|
||||||
val response = GetUserTanProceduresResponse(unmappedResponse)
|
|
||||||
dialogContext.response = response
|
|
||||||
|
|
||||||
if (response.successful) {
|
if (response.successful) {
|
||||||
updateBankData(dialogContext.bank, response)
|
updateBankData(dialogContext.bank, response)
|
||||||
|
|
|
@ -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
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue