Passing clientData to fints4k client

This commit is contained in:
dankito 2024-10-15 03:22:37 +02:00
parent ee21f684eb
commit c443656c03
3 changed files with 9 additions and 4 deletions

View File

@ -73,7 +73,9 @@ open class TransferMoneyRequest(
*/
val preferredTanMethods: List<TanMethodType>? = TanMethodType.NonVisualOrImageBased,
val tanMethodsNotSupportedByApplication: List<TanMethodType> = TanMethodType.TanMethodsNotSupportedByMostApplications
val tanMethodsNotSupportedByApplication: List<TanMethodType> = TanMethodType.TanMethodsNotSupportedByMostApplications,
val clientData: String? = null
) {
override fun toString() = "$amount to $recipientName - $paymentReference"
}

View File

@ -37,7 +37,9 @@ open class TransferMoneyRequestForUser(
preferredTanMethods: List<TanMethodType>? = TanMethodType.NonVisualOrImageBased,
tanMethodsNotSupportedByApplication: List<TanMethodType> = TanMethodType.TanMethodsNotSupportedByMostApplications,
) : TransferMoneyRequest(senderAccount, recipientName, recipientAccountIdentifier, recipientBankIdentifier, amount, currency, paymentReference, instantTransfer, preferredTanMethods, tanMethodsNotSupportedByApplication) {
clientData: String? = null
) : TransferMoneyRequest(senderAccount, recipientName, recipientAccountIdentifier, recipientBankIdentifier, amount, currency, paymentReference, instantTransfer, preferredTanMethods, tanMethodsNotSupportedByApplication, clientData) {
constructor(bankCode: String, loginName: String, password: String, request: TransferMoneyRequest)
: this(bankCode, loginName, password, request.senderAccount, request.recipientName, request.recipientAccountIdentifier, request.recipientBankIdentifier,
@ -49,7 +51,7 @@ open class TransferMoneyRequestForUser(
amount: Amount, currency: String = DefaultValues.DefaultCurrency, paymentReference: String? = null, instantTransfer: Boolean = false
) : this(bank.domesticBankCode, bank.loginName, bank.password!!, account?.let { BankAccountIdentifier(it.identifier, it.subAccountNumber, it.iban) },
recipientName, recipientAccountIdentifier, recipientBankIdentifier, amount, currency, paymentReference, instantTransfer,
listOf(bank.selectedTanMethod.type) + TanMethodType.NonVisualOrImageBased) {
listOf(bank.selectedTanMethod.type) + TanMethodType.NonVisualOrImageBased, TanMethodType.TanMethodsNotSupportedByMostApplications, bank.clientData) {
this.bank = bank
this.account = account
}

View File

@ -395,7 +395,8 @@ open class FinTs4kMapper {
request.recipientName, request.recipientAccountIdentifier, request.recipientBankIdentifier,
mapToMoney(request.amount, request.currency), request.paymentReference, request.instantTransfer,
request.preferredTanMethods?.map { mapTanMethodType(it) },
request.tanMethodsNotSupportedByApplication.map { mapTanMethodType(it) }
request.tanMethodsNotSupportedByApplication.map { mapTanMethodType(it) },
finTsModel = request.clientData?.let { serializer.deserializeFromJson(it) }
)
open fun mapTransferMoneyResponse(response: net.dankito.banking.client.model.response.TransferMoneyResponse): Response<TransferMoneyResponse> =