Getting customer system ID now when opening a dialog -> no extra dialog just to get customer system id is needed anymore. Hope that works for all banks

This commit is contained in:
dankito 2020-05-17 12:15:11 +02:00
parent 6ceba92834
commit 247e77586a
2 changed files with 8 additions and 6 deletions

View File

@ -10,7 +10,6 @@ import net.dankito.fints.messages.datenelemente.implementierte.tan.TanGeneratorT
import net.dankito.fints.messages.datenelemente.implementierte.tan.TanMedienArtVersion
import net.dankito.fints.messages.datenelemente.implementierte.tan.TanMediumKlasse
import net.dankito.fints.messages.datenelemente.implementierte.tan.ZkaTanProcedure
import net.dankito.fints.messages.segmente.id.CustomerSegmentId
import net.dankito.fints.model.*
import net.dankito.fints.response.GetUserTanProceduresResponse
import net.dankito.fints.response.InstituteSegmentId
@ -204,12 +203,10 @@ open class FinTsClient @JvmOverloads constructor(
}
/* Second dialog: Get customer system ID */ // TODO: needed?
val synchronizeCustomerResponse = synchronizeCustomerSystemId(bank, customer)
/* Second dialog: Get customer system ID - done now in getBankAndCustomerInfoForNewUser(), we try to make it without having to open an extra dialog */
/* Third dialog: Get customer TAN media list */
/* Third dialog: Get customer TAN media list - last step that can and must be done without strong customer authorization */
getTanMediaList(bank, customer, TanMedienArtVersion.Alle, TanMediumKlasse.AlleMedien)
@ -237,7 +234,7 @@ open class FinTsClient @JvmOverloads constructor(
val unbookedTransactions = transactionsOfLast90DaysResponses.flatMap { it.unbookedTransactions }
val bookedTransactions = transactionsOfLast90DaysResponses.flatMap { it.bookedTransactions }
return AddAccountResponse(synchronizeCustomerResponse.toResponse(), bank, customer,
return AddAccountResponse(newUserInfoResponse.toResponse(), bank, customer,
supportsRetrievingTransactionsOfLast90DaysWithoutTan, bookedTransactions, unbookedTransactions, balances)
}

View File

@ -1,6 +1,7 @@
package net.dankito.fints.messages
import net.dankito.fints.messages.datenelemente.implementierte.Aufsetzpunkt
import net.dankito.fints.messages.datenelemente.implementierte.KundensystemID
import net.dankito.fints.messages.datenelemente.implementierte.Synchronisierungsmodus
import net.dankito.fints.messages.datenelemente.implementierte.tan.TanGeneratorTanMedium
import net.dankito.fints.messages.datenelemente.implementierte.tan.TanMedienArtVersion
@ -74,6 +75,10 @@ open class MessageBuilder(protected val generator: ISegmentNumberGenerator = Seg
segments.add(ZweiSchrittTanEinreichung(generator.getNextSegmentNumber(), TanProcess.TanProcess4, CustomerSegmentId.Identification))
}
if (dialogContext.customer.customerSystemId == KundensystemID.Anonymous) {
segments.add(Synchronisierung(generator.getNextSegmentNumber(), Synchronisierungsmodus.NeueKundensystemIdZurueckmelden))
}
return createSignedMessageBuilderResult(dialogContext, segments)
}