libeufin

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

commit 1656ff8ac1ff4a70121b8ae67933a165b3dfa516
parent e30e0ba3866fe79dca0e02a74ec9de033ab732f5
Author: MS <ms@taler.net>
Date:   Mon,  8 Jun 2020 16:45:29 +0200

submitter task: avoid doubled submissions

Diffstat:
Mintegration-tests/test-taler-facade.py | 6+++---
Mintegration-tests/util.py | 2+-
Mnexus/src/main/kotlin/tech/libeufin/nexus/taler.kt | 3++-
3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/integration-tests/test-taler-facade.py b/integration-tests/test-taler-facade.py @@ -37,8 +37,8 @@ BANK_ACCOUNT_LABEL = "savings" BANK_CONNECTION_LABEL = "my-ebics" # Databases -NEXUS_DB="/tmp/test-nexus.sqlite3" -SANDBOX_DB="/tmp/test-sandbox.sqlite3" +NEXUS_DB="test-nexus.sqlite3" +SANDBOX_DB="test-sandbox.sqlite3" def fail(msg): print(msg) @@ -163,7 +163,7 @@ assertResponse( amount="EUR:1", exchange_base_url="http//url", wtid="nice", - credit_account="payto://iban/THEIBAN/THEBIC?name=theName" + credit_account="payto://iban/THEBIC/THEIBAN?name=theName" ), headers=dict(Authorization=USER_AUTHORIZATION_HEADER) ) diff --git a/integration-tests/util.py b/integration-tests/util.py @@ -18,7 +18,7 @@ def checkPort(port): exit(77) -def startSandbox(dbname = "libeufin-sandbox.sqlite3"): +def startSandbox(dbname): db_full_path = str(Path.cwd() / dbname) check_call(["rm", "-f", db_full_path]) check_call(["../gradlew", "-p", "..", "sandbox:assemble"]) diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt @@ -399,7 +399,8 @@ suspend fun submitPreparedPaymentsViaEbics() { HttpStatusCode.InternalServerError, "Bank account '${it.bankAccount}' not found for facade '${it.id.value}'" ) - PreparedPaymentEntity.find { PreparedPaymentsTable.debitorIban eq bankAccount.iban }.forEach { + PreparedPaymentEntity.find { PreparedPaymentsTable.debitorIban eq bankAccount.iban and + not(PreparedPaymentsTable.submitted) }.forEach { val pain001document = createPain001document(it) logger.debug("Preparing payment: ${pain001document}") val subscriberDetails = getEbicsSubscriberDetailsInternal(subscriberEntity)