libeufin

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

commit 47ce51c1be1d10c9427dd2450ae99fa9e66a4136
parent d865d364b46739ddc32996a9cb76997e8b057415
Author: ms <ms@taler.net>
Date:   Thu, 14 Jan 2021 19:12:01 +0100

fix loop skip

Diffstat:
Mcli/setup-template.sh | 11+++++------
Mnexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt | 6++----
Msandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt | 8+-------
3 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/cli/setup-template.sh b/cli/setup-template.sh @@ -122,12 +122,11 @@ echo Download bank accounts cat << EOF -env-setter: - export NEXUS_BASE_URL=http://localhost:5001/ NEXUS_USERNAME=$NEXUS_USER NEXUS_PASSWORD=$NEXUS_PASSWORD LIBEUFIN_SANDBOX_URL=$SANDBOX_URL - -Connection: $(tput bold)$NEXUS_BANK_CONNECTION_NAME$(tput sgr0) -Account (imported): $(tput bold)$ACCOUNT_NAME_AT_NEXUS$(tput sgr0) +Bank connection name: $(tput bold)$NEXUS_BANK_CONNECTION_NAME$(tput sgr0) +Bank account, imported name: $(tput bold)$ACCOUNT_NAME_AT_NEXUS$(tput sgr0) +Bank account, native name: $(tput bold)$ACCOUNT_NAME$(tput sgr0) +env-setter: $(tput bold)export NEXUS_BASE_URL=http://localhost:5001/ NEXUS_USERNAME=$NEXUS_USER NEXUS_PASSWORD=$NEXUS_PASSWORD LIBEUFIN_SANDBOX_URL=$SANDBOX_URL$(tput sgr0) EOF -read -p "Press Enter to terminate the services:" +read -p "Press Enter to terminate the services: " diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt @@ -126,9 +126,7 @@ fun processCamtMessage(bankAccountId: String, camtDoc: Document, code: String): if (acct == null) { throw NexusError(HttpStatusCode.NotFound, "user not found") } - val res = try { - parseCamtMessage(camtDoc) - } catch (e: CamtParsingError) { + val res = try { parseCamtMessage(camtDoc) } catch (e: CamtParsingError) { logger.warn("Invalid CAMT received from bank: $e") return@transaction false } @@ -166,7 +164,7 @@ fun processCamtMessage(bankAccountId: String, camtDoc: Document, code: String): logger.info("Found a duplicate: $acctSvcrRef") // FIXME(dold): See if an old transaction needs to be superseded by this one // https://bugs.gnunet.org/view.php?id=6381 - break + continue@txloop } val rawEntity = NexusBankTransactionEntity.new { bankAccount = acct diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt @@ -441,11 +441,7 @@ fun buildCamtString(type: Int, subscriberIban: String, history: List<RawPayment> * * @param type 52 or 53. */ -private fun constructCamtResponse( - type: Int, - header: EbicsRequest.Header, - subscriber: EbicsSubscriberEntity -): MutableList<String> { +private fun constructCamtResponse(type: Int, header: EbicsRequest.Header, subscriber: EbicsSubscriberEntity): MutableList<String> { val dateRange = (header.static.orderDetails?.orderParams as EbicsRequest.StandardOrderParams).dateRange val (start: LocalDateTime, end: LocalDateTime) = if (dateRange != null) { Pair( @@ -1149,9 +1145,7 @@ private fun makeRequestContext(requestObject: EbicsRequest): RequestContext { suspend fun ApplicationCall.ebicsweb() { val requestDocument = receiveEbicsXml() - LOGGER.info("Processing ${requestDocument.documentElement.localName}") - when (requestDocument.documentElement.localName) { "ebicsUnsecuredRequest" -> { val requestObject = requestDocument.toObject<EbicsUnsecuredRequest>()