If Pin or chipTan is locked only warning but no error is returned by server -> check also these feedbacks to detect if response was successful

This commit is contained in:
dankito 2020-10-16 19:03:21 +02:00
parent df4c8c4a1a
commit e4b6a7efd5
2 changed files with 9 additions and 2 deletions

View File

@ -25,7 +25,11 @@ open class BankResponse(
get() = messageCreationError == null get() = messageCreationError == null
open val responseContainsErrors: Boolean open val responseContainsErrors: Boolean
get() = errorMessage == null && messageFeedback?.isError == true get() = errorMessage == null &&
(messageFeedback?.isError == true || isPinLocked)
open val isPinLocked: Boolean
get() = segmentFeedbacks.flatMap { it.feedbacks }.any { it.isPinLocked }
open val wrongCredentialsEntered: Boolean open val wrongCredentialsEntered: Boolean
get() { get() {
@ -98,7 +102,7 @@ open class BankResponse(
} }
protected open fun mapToMessageToShowToUser(feedback: Feedback): String? { protected open fun mapToMessageToShowToUser(feedback: Feedback): String? {
if (feedback.isError) { if (feedback.isError || feedback.isPinLocked) {
if (feedback.responseCode != 9800) { // filter out 'Dialogabbruch' feedbacks, is of no value to user if (feedback.responseCode != 9800) { // filter out 'Dialogabbruch' feedbacks, is of no value to user
return "${feedback.responseCode}: ${feedback.message}" return "${feedback.responseCode}: ${feedback.message}"
} }

View File

@ -45,6 +45,9 @@ open class Feedback(
val isWarning: Boolean val isWarning: Boolean
get() = responseCode in 3000..3999 get() = responseCode in 3000..3999
val isPinLocked: Boolean
get() = responseCode in 3930..3939
val isError: Boolean val isError: Boolean
get() = responseCode in 9000..9999 get() = responseCode in 9000..9999