Fixed that if lastCreatedMesssage is a DialogInit message, that we don't sent it again as we just initialized a new dialog with initDialogWithStrongCustomerAuthentication()
This commit is contained in:
parent
df692ea222
commit
684b3fb40e
2 changed files with 10 additions and 1 deletions
|
@ -590,7 +590,8 @@ Log.info { "Terminating waiting for TAN input" } // TODO: remove again
|
||||||
|
|
||||||
val initDialogResponse = initDialogWithStrongCustomerAuthentication(context)
|
val initDialogResponse = initDialogWithStrongCustomerAuthentication(context)
|
||||||
|
|
||||||
if (initDialogResponse.successful == false) {
|
// if lastCreatedMessage was a dialog init message, there's no need to send this message again, we just initialized a new dialog in initDialogWithStrongCustomerAuthentication()
|
||||||
|
if (initDialogResponse.successful == false || lastCreatedMessage.isDialogInitMessage()) {
|
||||||
return initDialogResponse
|
return initDialogResponse
|
||||||
} else {
|
} else {
|
||||||
val newMessage = messageBuilder.rebuildMessage(context, lastCreatedMessage)
|
val newMessage = messageBuilder.rebuildMessage(context, lastCreatedMessage)
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package net.codinux.banking.fints.messages
|
package net.codinux.banking.fints.messages
|
||||||
|
|
||||||
|
import net.codinux.banking.fints.messages.datenelementgruppen.implementierte.Segmentkopf
|
||||||
import net.codinux.banking.fints.messages.segmente.Segment
|
import net.codinux.banking.fints.messages.segmente.Segment
|
||||||
|
import net.codinux.banking.fints.messages.segmente.implementierte.Verarbeitungsvorbereitung
|
||||||
import net.codinux.banking.fints.messages.segmente.implementierte.ZweiSchrittTanEinreichung
|
import net.codinux.banking.fints.messages.segmente.implementierte.ZweiSchrittTanEinreichung
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,4 +34,10 @@ open class MessageBuilderResult(
|
||||||
&& messageBodySegments.first() is ZweiSchrittTanEinreichung
|
&& messageBodySegments.first() is ZweiSchrittTanEinreichung
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open fun isDialogInitMessage(): Boolean =
|
||||||
|
messageBodySegments.any { it is Verarbeitungsvorbereitung }
|
||||||
|
|
||||||
|
|
||||||
|
override fun toString() = "${messageBodySegments.joinToString { (it.dataElementsAndGroups.firstOrNull() as? Segmentkopf)?.let { "${it.identifier}:${it.segmentVersion}" } ?: "<No Segment header>" } }}"
|
||||||
|
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue