Renamed initDialog() to initDialogWithStrongCustomerAuthentication()
This commit is contained in:
parent
dd01c7416a
commit
9e5b18a522
|
@ -188,7 +188,7 @@ open class FinTsClient(
|
||||||
|
|
||||||
val dialogContext = DialogContext(bank, product)
|
val dialogContext = DialogContext(bank, product)
|
||||||
|
|
||||||
initDialogAfterSuccessfulChecks(dialogContext) { initDialogResponse ->
|
initDialogWithStrongCustomerAuthenticationAfterSuccessfulPreconditionChecks(dialogContext) { initDialogResponse ->
|
||||||
closeDialog(dialogContext)
|
closeDialog(dialogContext)
|
||||||
|
|
||||||
callback(initDialogResponse)
|
callback(initDialogResponse)
|
||||||
|
@ -202,7 +202,7 @@ open class FinTsClient(
|
||||||
|
|
||||||
val dialogContext = DialogContext(bank, product)
|
val dialogContext = DialogContext(bank, product)
|
||||||
|
|
||||||
initDialogAfterSuccessfulChecks(dialogContext) { response ->
|
initDialogWithStrongCustomerAuthenticationAfterSuccessfulPreconditionChecks(dialogContext) { response ->
|
||||||
closeDialog(dialogContext)
|
closeDialog(dialogContext)
|
||||||
|
|
||||||
if (response.successful) {
|
if (response.successful) {
|
||||||
|
@ -273,7 +273,7 @@ open class FinTsClient(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Second dialgo: some banks require that in order to initialize a dialog with strong customer authorization TAN media is required */
|
/* Second dialog: some banks require that in order to initialize a dialog with strong customer authorization TAN media is required */
|
||||||
|
|
||||||
getTanMediaList(bank, TanMedienArtVersion.Alle, TanMediumKlasse.AlleMedien) {
|
getTanMediaList(bank, TanMedienArtVersion.Alle, TanMediumKlasse.AlleMedien) {
|
||||||
|
|
||||||
|
@ -356,7 +356,7 @@ open class FinTsClient(
|
||||||
|
|
||||||
val dialogContext = DialogContext(bank, product)
|
val dialogContext = DialogContext(bank, product)
|
||||||
|
|
||||||
initDialog(dialogContext) { initDialogResponse ->
|
initDialogWithStrongCustomerAuthentication(dialogContext) { initDialogResponse ->
|
||||||
|
|
||||||
if (initDialogResponse.successful == false) {
|
if (initDialogResponse.successful == false) {
|
||||||
callback(GetTransactionsResponse(initDialogResponse, RetrievedAccountData.unsuccessfulList(parameter.account)))
|
callback(GetTransactionsResponse(initDialogResponse, RetrievedAccountData.unsuccessfulList(parameter.account)))
|
||||||
|
@ -517,12 +517,12 @@ open class FinTsClient(
|
||||||
val dialogContext = DialogContext(bank, product)
|
val dialogContext = DialogContext(bank, product)
|
||||||
|
|
||||||
if (segmentForNonStrongCustomerAuthenticationTwoStepTanProcess == null) {
|
if (segmentForNonStrongCustomerAuthenticationTwoStepTanProcess == null) {
|
||||||
initDialog(dialogContext) { initDialogResponse ->
|
initDialogWithStrongCustomerAuthentication(dialogContext) { initDialogResponse ->
|
||||||
sendMessageAndHandleResponseAfterDialogInitialization(dialogContext, initDialogResponse, createMessage, callback)
|
sendMessageAndHandleResponseAfterDialogInitialization(dialogContext, initDialogResponse, createMessage, callback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
initInitDialogMessageWithoutStrongCustomerAuthenticationAfterSuccessfulChecks(dialogContext, segmentForNonStrongCustomerAuthenticationTwoStepTanProcess) { initDialogResponse ->
|
initDialogMessageWithoutStrongCustomerAuthenticationAfterSuccessfulChecks(dialogContext, segmentForNonStrongCustomerAuthenticationTwoStepTanProcess) { initDialogResponse ->
|
||||||
sendMessageAndHandleResponseAfterDialogInitialization(dialogContext, initDialogResponse, createMessage, callback)
|
sendMessageAndHandleResponseAfterDialogInitialization(dialogContext, initDialogResponse, createMessage, callback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -544,7 +544,7 @@ open class FinTsClient(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun initDialog(dialogContext: DialogContext, callback: (BankResponse) -> Unit) {
|
protected open fun initDialogWithStrongCustomerAuthentication(dialogContext: DialogContext, callback: (BankResponse) -> Unit) {
|
||||||
|
|
||||||
// we first need to retrieve supported tan methods and jobs before we can do anything
|
// we first need to retrieve supported tan methods and jobs before we can do anything
|
||||||
ensureBasicBankDataRetrieved(dialogContext.bank) { retrieveBasicBankDataResponse ->
|
ensureBasicBankDataRetrieved(dialogContext.bank) { retrieveBasicBankDataResponse ->
|
||||||
|
@ -558,14 +558,14 @@ open class FinTsClient(
|
||||||
callback(tanMethodSelectedResponse)
|
callback(tanMethodSelectedResponse)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
initDialogAfterSuccessfulChecks(dialogContext, callback)
|
initDialogWithStrongCustomerAuthenticationAfterSuccessfulPreconditionChecks(dialogContext, callback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun initDialogAfterSuccessfulChecks(dialogContext: DialogContext, callback: (BankResponse) -> Unit) {
|
protected open fun initDialogWithStrongCustomerAuthenticationAfterSuccessfulPreconditionChecks(dialogContext: DialogContext, callback: (BankResponse) -> Unit) {
|
||||||
|
|
||||||
val message = messageBuilder.createInitDialogMessage(dialogContext)
|
val message = messageBuilder.createInitDialogMessage(dialogContext)
|
||||||
|
|
||||||
|
@ -580,8 +580,8 @@ open class FinTsClient(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun initInitDialogMessageWithoutStrongCustomerAuthenticationAfterSuccessfulChecks(dialogContext: DialogContext, segmentIdForTwoStepTanProcess: CustomerSegmentId?,
|
protected open fun initDialogMessageWithoutStrongCustomerAuthenticationAfterSuccessfulChecks(dialogContext: DialogContext, segmentIdForTwoStepTanProcess: CustomerSegmentId?,
|
||||||
callback: (BankResponse) -> Unit) {
|
callback: (BankResponse) -> Unit) {
|
||||||
|
|
||||||
val message = messageBuilder.createInitDialogMessageWithoutStrongCustomerAuthentication(dialogContext, segmentIdForTwoStepTanProcess)
|
val message = messageBuilder.createInitDialogMessageWithoutStrongCustomerAuthentication(dialogContext, segmentIdForTwoStepTanProcess)
|
||||||
|
|
||||||
|
@ -956,7 +956,7 @@ open class FinTsClient(
|
||||||
if (lastCreatedMessage != null) { // do not use previousDialogContext.currentMessage as this may is previous dialog's dialog close message
|
if (lastCreatedMessage != null) { // do not use previousDialogContext.currentMessage as this may is previous dialog's dialog close message
|
||||||
val newDialogContext = DialogContext(previousDialogContext.bank, previousDialogContext.product, chunkedResponseHandler = previousDialogContext.chunkedResponseHandler)
|
val newDialogContext = DialogContext(previousDialogContext.bank, previousDialogContext.product, chunkedResponseHandler = previousDialogContext.chunkedResponseHandler)
|
||||||
|
|
||||||
initDialog(newDialogContext) { initDialogResponse ->
|
initDialogWithStrongCustomerAuthentication(newDialogContext) { initDialogResponse ->
|
||||||
if (initDialogResponse.successful == false) {
|
if (initDialogResponse.successful == false) {
|
||||||
callback(initDialogResponse)
|
callback(initDialogResponse)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue