Implemented sending entered tan and returning retrieved result
This commit is contained in:
parent
d374767400
commit
14bc302c6d
|
@ -495,7 +495,7 @@ open class FinTsClient @JvmOverloads constructor(
|
|||
response.tanRequiredButNotProvided = true
|
||||
}
|
||||
else {
|
||||
return sendTanToBank(enteredTan, tanResponse)
|
||||
return sendTanToBank(enteredTan, tanResponse, bank, customer, dialogData)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -503,9 +503,14 @@ open class FinTsClient @JvmOverloads constructor(
|
|||
return response
|
||||
}
|
||||
|
||||
protected open fun sendTanToBank(enteredTan: String, tanResponse: TanResponse): Response {
|
||||
// TODO
|
||||
return Response(false)
|
||||
protected open fun sendTanToBank(enteredTan: String, tanResponse: TanResponse, bank: BankData,
|
||||
customer: CustomerData, dialogData: DialogData): Response {
|
||||
|
||||
dialogData.increaseMessageNumber()
|
||||
|
||||
val message = messageBuilder.createSendEnteredTanMessage(enteredTan, tanResponse, bank, customer, dialogData)
|
||||
|
||||
return getAndHandleResponseForMessageThatMayRequiresTan(message, bank, customer, dialogData)
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ import net.dankito.fints.messages.segmente.implementierte.umsaetze.Saldenabfrage
|
|||
import net.dankito.fints.model.*
|
||||
import net.dankito.fints.response.segments.JobParameters
|
||||
import net.dankito.fints.response.segments.SepaAccountInfoParameters
|
||||
import net.dankito.fints.response.segments.TanResponse
|
||||
import net.dankito.fints.util.FinTsUtils
|
||||
import kotlin.random.Random
|
||||
|
||||
|
@ -131,6 +132,17 @@ open class MessageBuilder(protected val generator: ISegmentNumberGenerator = Seg
|
|||
}
|
||||
|
||||
|
||||
open fun createSendEnteredTanMessage(enteredTan: String, tanResponse: TanResponse, bank: BankData, customer: CustomerData, dialogData: DialogData): MessageBuilderResult {
|
||||
|
||||
val tanProcess = if (tanResponse.tanProcess == TanProcess.TanProcess1) TanProcess.TanProcess1 else TanProcess.TanProcess2
|
||||
|
||||
return MessageBuilderResult(createSignedMessage(bank, customer, dialogData, enteredTan, listOf(
|
||||
ZweiSchrittTanEinreichung(generator.resetSegmentNumber(2), tanProcess, null,
|
||||
tanResponse.jobHashValue, tanResponse.jobReference, false, null, tanResponse.tanMediaIdentifier)
|
||||
)))
|
||||
}
|
||||
|
||||
|
||||
open fun createBankTransferMessage(bankTransferData: BankTransferData, bank: BankData, customer: CustomerData, dialogData: DialogData): MessageBuilderResult {
|
||||
|
||||
val result = getSupportedVersionsOfJob(CustomerSegmentId.SepaBankTransfer, customer, listOf(1))
|
||||
|
|
Loading…
Reference in New Issue