Added tanMediaIdentifier to TanChallenge; added toString()
This commit is contained in:
parent
110fc59756
commit
a589fc89e2
|
@ -607,9 +607,7 @@ open class FinTsClient @JvmOverloads constructor(
|
||||||
protected open fun handleMayRequiredTan(response: Response, bank: BankData, customer: CustomerData, dialogData: DialogData): Response {
|
protected open fun handleMayRequiredTan(response: Response, bank: BankData, customer: CustomerData, dialogData: DialogData): Response {
|
||||||
if (response.isStrongAuthenticationRequired) {
|
if (response.isStrongAuthenticationRequired) {
|
||||||
response.tanResponse?.let { tanResponse ->
|
response.tanResponse?.let { tanResponse ->
|
||||||
// TODO: is this true for all tan procedures?
|
val enteredTanResult = callback.enterTan(customer, createTanChallenge(tanResponse, customer))
|
||||||
val enteredTanResult = callback.enterTan(customer, TanChallenge(tanResponse.challenge ?: "",
|
|
||||||
tanResponse.challengeHHD_UC ?: "", customer.selectedTanProcedure))
|
|
||||||
|
|
||||||
if (enteredTanResult.changeTanProcedureTo != null) {
|
if (enteredTanResult.changeTanProcedureTo != null) {
|
||||||
return handleUserAsksToChangeTanProcedureAndResendLastMessage(enteredTanResult.changeTanProcedureTo,
|
return handleUserAsksToChangeTanProcedureAndResendLastMessage(enteredTanResult.changeTanProcedureTo,
|
||||||
|
@ -640,6 +638,15 @@ open class FinTsClient @JvmOverloads constructor(
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected open fun createTanChallenge(tanResponse: TanResponse, customer: CustomerData): TanChallenge {
|
||||||
|
// TODO: is this true for all tan procedures?
|
||||||
|
val messageToShowToUser = tanResponse.challenge ?: ""
|
||||||
|
val challenge = tanResponse.challengeHHD_UC ?: ""
|
||||||
|
val tanProcedure = customer.selectedTanProcedure
|
||||||
|
|
||||||
|
return TanChallenge(messageToShowToUser, challenge, tanProcedure, tanResponse.tanMediaIdentifier)
|
||||||
|
}
|
||||||
|
|
||||||
protected open fun sendTanToBank(enteredTan: String, tanResponse: TanResponse, bank: BankData,
|
protected open fun sendTanToBank(enteredTan: String, tanResponse: TanResponse, bank: BankData,
|
||||||
customer: CustomerData, dialogData: DialogData): Response {
|
customer: CustomerData, dialogData: DialogData): Response {
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,13 @@ package net.dankito.fints.model
|
||||||
|
|
||||||
open class TanChallenge(
|
open class TanChallenge(
|
||||||
val messageToShowToUser: String,
|
val messageToShowToUser: String,
|
||||||
val tanChallenge: String,
|
val challenge: String,
|
||||||
val tanProcedure: TanProcedure
|
val tanProcedure: TanProcedure,
|
||||||
)
|
val tanMediaIdentifier: String?
|
||||||
|
) {
|
||||||
|
|
||||||
|
override fun toString(): String {
|
||||||
|
return "$tanProcedure (medium: $tanMediaIdentifier): $messageToShowToUser"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue