libeufin

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

commit 81ecdd6bf707bc41f028ff7da71dc30f4f576a49
parent b57e69e8cd4fd4f8d793e5698bcb864626382384
Author: Florian Dold <florian.dold@gmail.com>
Date:   Tue, 11 Feb 2020 15:48:08 +0100

json body

Diffstat:
Mnexus/src/main/kotlin/tech/libeufin/nexus/Db.kt | 37+++++++++++++++++++++++++++++++++++++
Mnexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 4++++
Msandbox/src/main/python/libeufin-cli | 2+-
3 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Db.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Db.kt @@ -4,10 +4,47 @@ import org.jetbrains.exposed.dao.* import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.transactions.TransactionManager import org.jetbrains.exposed.sql.transactions.transaction +import tech.libeufin.nexus.EbicsSubscribersTable.entityId +import tech.libeufin.nexus.EbicsSubscribersTable.primaryKey import java.sql.Connection const val ID_MAX_LENGTH = 50 + +object EbicsRawBankTransactionsTable : IdTable<Long>() { + override val id = EbicsSubscribersTable.long("id").entityId().primaryKey() + + val nexusSubscriber = reference("subscriber", EbicsSubscribersTable) + + /** + * How did we learn about this transaction? C52 / C53 / C54 + */ + val sourceType = text("sourceType") + + val sourceFileName = text("sourceFileName") + + + + /** + * "Subject" of the SEPA transaction + */ + val unstructuredRemittanceInformation = text("unstructuredRemittanceInformation") + + /** + * Is it a credit or debit transaction? + */ + val transactionType = text("transactionType") + + val currency = text("currency") + + val amount = text("amount") + + val creditorIban = text("creditorIban") + + val debitorIban = text("creditorIban") +} + + object EbicsSubscribersTable : IdTable<String>() { override val id = varchar("id", ID_MAX_LENGTH).entityId().primaryKey() val ebicsURL = text("ebicsURL") diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt @@ -288,6 +288,10 @@ fun main() { } } + post("/ebics/subscribers/{id}/collect-transactions-c52") { + // Download C52 and store the result in the right database table + } + post("/ebics/subscribers/{id}/sendC52") { val id = expectId(call.parameters["id"]) val paramsJson = call.receive<EbicsStandardOrderParamsJson>() diff --git a/sandbox/src/main/python/libeufin-cli b/sandbox/src/main/python/libeufin-cli @@ -570,7 +570,7 @@ def htd(ctx, account_id, prepare, nexus_base_url): ctx.invoke(sync) url = urljoin(nexus_base_url, "/ebics/subscribers/{}/sendHtd".format(account_id)) try: - resp = post(url) + resp = post(url, json=dict()) except Exception: print("Could not reach the bank") return