From c443656c0361dbaf995e36cc09c963ed64417aae Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 15 Oct 2024 03:22:37 +0200 Subject: [PATCH] Passing clientData to fints4k client --- .../banking/client/model/request/TransferMoneyRequest.kt | 4 +++- .../client/model/request/TransferMoneyRequestForUser.kt | 6 ++++-- .../net/codinux/banking/client/fints4k/FinTs4kMapper.kt | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequest.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequest.kt index e12535ad..37af7e5a 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequest.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequest.kt @@ -73,7 +73,9 @@ open class TransferMoneyRequest( */ val preferredTanMethods: List? = TanMethodType.NonVisualOrImageBased, - val tanMethodsNotSupportedByApplication: List = TanMethodType.TanMethodsNotSupportedByMostApplications + val tanMethodsNotSupportedByApplication: List = TanMethodType.TanMethodsNotSupportedByMostApplications, + + val clientData: String? = null ) { override fun toString() = "$amount to $recipientName - $paymentReference" } \ No newline at end of file diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequestForUser.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequestForUser.kt index 7cf081d3..cc46175f 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequestForUser.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequestForUser.kt @@ -37,7 +37,9 @@ open class TransferMoneyRequestForUser( preferredTanMethods: List? = TanMethodType.NonVisualOrImageBased, tanMethodsNotSupportedByApplication: List = 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 } diff --git a/FinTs4jBankingClient/src/commonMain/kotlin/net/codinux/banking/client/fints4k/FinTs4kMapper.kt b/FinTs4jBankingClient/src/commonMain/kotlin/net/codinux/banking/client/fints4k/FinTs4kMapper.kt index 4fa6d3da..b781764f 100644 --- a/FinTs4jBankingClient/src/commonMain/kotlin/net/codinux/banking/client/fints4k/FinTs4kMapper.kt +++ b/FinTs4jBankingClient/src/commonMain/kotlin/net/codinux/banking/client/fints4k/FinTs4kMapper.kt @@ -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 =