Implemented calling getTanMediaList() only if retrieving TAN media is supported
This commit is contained in:
parent
63ec9e074a
commit
24dfe34c1f
|
@ -11,6 +11,7 @@ import net.dankito.banking.fints.messages.datenelemente.implementierte.signatur.
|
||||||
import net.dankito.banking.fints.messages.datenelemente.implementierte.signatur.VersionDesSicherheitsverfahrens
|
import net.dankito.banking.fints.messages.datenelemente.implementierte.signatur.VersionDesSicherheitsverfahrens
|
||||||
import net.dankito.banking.fints.messages.datenelemente.implementierte.tan.*
|
import net.dankito.banking.fints.messages.datenelemente.implementierte.tan.*
|
||||||
import net.dankito.banking.fints.messages.segmente.id.CustomerSegmentId
|
import net.dankito.banking.fints.messages.segmente.id.CustomerSegmentId
|
||||||
|
import net.dankito.banking.fints.messages.segmente.id.ISegmentId
|
||||||
import net.dankito.banking.fints.model.*
|
import net.dankito.banking.fints.model.*
|
||||||
import net.dankito.banking.fints.response.InstituteSegmentId
|
import net.dankito.banking.fints.response.InstituteSegmentId
|
||||||
import net.dankito.banking.fints.response.BankResponse
|
import net.dankito.banking.fints.response.BankResponse
|
||||||
|
@ -271,7 +272,19 @@ open class FinTsClient(
|
||||||
|
|
||||||
/* Second dialog: 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 */
|
||||||
|
|
||||||
|
if (isJobSupported(bank, CustomerSegmentId.TanMediaList)) {
|
||||||
getTanMediaList(bank, TanMedienArtVersion.Alle, TanMediumKlasse.AlleMedien) {
|
getTanMediaList(bank, TanMedienArtVersion.Alle, TanMediumKlasse.AlleMedien) {
|
||||||
|
addAccountGetAccountsAndTransactions(parameter, bank, didOverwriteUserUnselectedTanMethod, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
addAccountGetAccountsAndTransactions(parameter, bank, didOverwriteUserUnselectedTanMethod, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected open fun addAccountGetAccountsAndTransactions(parameter: AddAccountParameter, bank: BankData, didOverwriteUserUnselectedTanMethod: Boolean,
|
||||||
|
callback: (AddAccountResponse) -> Unit) {
|
||||||
|
|
||||||
/* Third dialog: Now we can initialize our first dialog with strong customer authorization. Use it to get UPD and customer's accounts */
|
/* Third dialog: Now we can initialize our first dialog with strong customer authorization. Use it to get UPD and customer's accounts */
|
||||||
|
|
||||||
|
@ -292,8 +305,6 @@ open class FinTsClient(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected open fun addAccountGetAccountBalancesAndTransactions(bank: BankData, getAccountsResponse: BankResponse,
|
protected open fun addAccountGetAccountBalancesAndTransactions(bank: BankData, getAccountsResponse: BankResponse,
|
||||||
didOverwriteUserUnselectedTanMethod: Boolean,
|
didOverwriteUserUnselectedTanMethod: Boolean,
|
||||||
|
@ -1239,6 +1250,10 @@ open class FinTsClient(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected open fun isJobSupported(bank: BankData, segmentId: ISegmentId): Boolean {
|
||||||
|
return bank.supportedJobs.map { it.jobName }.contains(segmentId.id)
|
||||||
|
}
|
||||||
|
|
||||||
protected open fun isJobSupported(account: AccountData, supportedJob: JobParameters): Boolean {
|
protected open fun isJobSupported(account: AccountData, supportedJob: JobParameters): Boolean {
|
||||||
for (allowedJobName in account.allowedJobNames) {
|
for (allowedJobName in account.allowedJobNames) {
|
||||||
if (allowedJobName == supportedJob.jobName) {
|
if (allowedJobName == supportedJob.jobName) {
|
||||||
|
|
Loading…
Reference in New Issue