libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 1f70330aa38dc80e188cfc4b991aa19c15aef485
parent 0583cf84bed2a4c2f788ded5bdff15495305c7fe
Author: MS <ms@taler.net>
Date:   Mon, 21 Nov 2022 20:19:00 +0100

comments, var renaming

Diffstat:
Mnexus/src/main/kotlin/tech/libeufin/nexus/Scheduling.kt | 1-
Mnexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt | 1+
Mnexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt | 5++---
Mnexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt | 4+++-
Msandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt | 2+-
5 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Scheduling.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Scheduling.kt @@ -48,7 +48,6 @@ private data class TaskSchedule( private suspend fun runTask(client: HttpClient, sched: TaskSchedule) { logger.info("running task $sched") try { - when (sched.resourceType) { "bank-account" -> { when (sched.type) { diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt @@ -89,6 +89,7 @@ suspend fun submitAllPaymentInitiations(httpClient: HttpClient, accountid: Strin (PaymentInitiationsTable.submitted eq false) and ( PaymentInitiationsTable.bankAccount eq account.id) }.forEach { + // Filter out non EBICS. val defaultBankConnectionId = it.bankAccount.defaultBankConnection?.id ?: throw NexusError( HttpStatusCode.BadRequest, "needs default bank connection" diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt @@ -26,7 +26,6 @@ import io.ktor.client.HttpClient import io.ktor.client.features.* import io.ktor.client.request.* import io.ktor.http.* -import io.ktor.util.* import org.slf4j.Logger import org.slf4j.LoggerFactory import tech.libeufin.nexus.NexusError @@ -223,7 +222,7 @@ suspend fun doEbicsUploadTransaction( logger.debug("INIT phase passed!") /* now send actual payload */ - val tmp = createEbicsRequestForUploadTransferPhase( + val payload = createEbicsRequestForUploadTransferPhase( subscriberDetails, transactionID, preparedUploadData, @@ -232,7 +231,7 @@ suspend fun doEbicsUploadTransaction( val txRespStr = client.postToBank( subscriberDetails.ebicsUrl, - tmp + payload ) val txResp = parseAndValidateEbicsResponse(subscriberDetails, txRespStr) diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt @@ -112,7 +112,8 @@ private suspend fun fetchEbicsC5x( ) } catch (e: EbicsProtocolError) { /** - * This error type is not an actual error in this handler. + * Although given a error type, a empty transactions list does + * not mean anything wrong. */ if (e.ebicsTechnicalCode == EbicsReturnCode.EBICS_NO_DOWNLOAD_DATA_AVAILABLE) { logger.info("Could not find new transactions to download") @@ -543,6 +544,7 @@ class EbicsBankConnectionProtocol: BankConnectionProtocol { r.painMessage.toByteArray(Charsets.UTF_8), EbicsStandardOrderParams() ) + // Mark the payment as submitted. transaction { val paymentInitiation = PaymentInitiationEntity.findById(paymentInitiationId) ?: throw NexusError(HttpStatusCode.NotFound, "payment initiation not found") diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt @@ -283,7 +283,7 @@ fun buildCamtString( * - Proprietary code of the bank transaction * - Id of the servicer (Issuer and Code) */ - val creationTime = getUTCnow() + val creationTime = getUTCnow() // FIXME: should this be the payment time? val dashedDate = creationTime.toDashedDate() val zonedDateTime = creationTime.toZonedString() val creationTimeMillis = creationTime.toInstant().toEpochMilli()