Also taking now message feedbacks into account to evaluate if wrong credentials have been entered
This commit is contained in:
parent
1c3f3505b0
commit
75525d704a
|
@ -29,11 +29,25 @@ open class BankResponse(
|
|||
|
||||
open val wrongCredentialsEntered: Boolean
|
||||
get() {
|
||||
val wrongCredentialsEnteredFeedbacks = segmentFeedbacks.flatMap { it.feedbacks }
|
||||
.filter { it.responseCode in 9910..9949 || (it.responseCode == 9210 && it.message.contains("Unbekannt", true)) } // this is not 100 % correct, there are e.g. messages like "9941 TAN ungültig" or "9910 Chipkarte gesperrt", see p. 22-23 FinTS_Rueckmeldungscodes ->
|
||||
.filterNot { it.message.contains("TAN", true) || it.message.contains("Chipkarte", true) } // ... try to filter these
|
||||
return messageFeedback?.feedbacks?.any { isWrongCredentialsEnteredFeedback(it) } == true
|
||||
|| segmentFeedbacks.flatMap { it.feedbacks }.any { isWrongCredentialsEnteredFeedback(it) }
|
||||
}
|
||||
|
||||
return wrongCredentialsEnteredFeedbacks.isNotEmpty()
|
||||
protected open fun isWrongCredentialsEnteredFeedback(feedback: Feedback): Boolean {
|
||||
if (feedback.responseCode == 9340) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (feedback.responseCode in 9910..9949) { // this is not 100 % correct, there are e.g. messages like "9941 TAN ungültig" or "9910 Chipkarte gesperrt", see p. 22-23 FinTS_Rueckmeldungscodes ->
|
||||
return feedback.message.contains("TAN", true) == false && feedback.message.contains("Chipkarte", true) == false // ... try to filter these
|
||||
}
|
||||
|
||||
if (feedback.responseCode == 9210) { // there are many, many different messages with response code 9210, try to find these with 'Unbekannter Benutzer', 'Benutzerkennung ungültig', 'Bitte korrigieren Sie Ihre Zugangsdaten'
|
||||
return feedback.message.contains("Unbekannt", true) || feedback.message.contains("kennung", true)
|
||||
|| feedback.message.contains("Zugangsdaten", true)
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
open var tanRequiredButUserDidNotEnterOne = false
|
||||
|
|
Loading…
Reference in New Issue