libeufin

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

commit af131544dc7947a519d0def1502fed6bf74e1d0d
parent 3dc1088aa6276ba4a47e5753e415a120165f2843
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Thu, 26 Mar 2020 13:10:27 +0100

Define payments-separating table.

Diffstat:
Mnexus/src/main/kotlin/tech/libeufin/nexus/DB.kt | 21++++++++++++++++++++-
Mnexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 13++++++++++++-
2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt @@ -12,6 +12,23 @@ import java.sql.Connection const val ID_MAX_LENGTH = 50 +object ValidTalerIncomingPayments: LongIdTable() { + val payment = reference("payment", EbicsRawBankTransactionsTable) +} + +class ValidTalerIncomingPaymentEntry(id: EntityID<Long>) : LongEntity(id) { + companion object : LongEntityClass<ValidTalerIncomingPaymentEntry>(ValidTalerIncomingPayments) + var payment by EbicsRawBankTransactionEntry referencedOn ValidTalerIncomingPayments.payment +} + +object InvalidTalerIncomingPayments: LongIdTable() { + val payment = reference("payment", EbicsRawBankTransactionsTable) +} + +class InvalidTalerIncomingPaymentEntry(id: EntityID<Long>) : LongEntity(id) { + companion object : LongEntityClass<InvalidTalerIncomingPaymentEntry>(InvalidTalerIncomingPayments) + var payment by EbicsRawBankTransactionEntry referencedOn InvalidTalerIncomingPayments.payment +} object EbicsRawBankTransactionsTable : LongIdTable() { val nexusSubscriber = reference("subscriber", EbicsSubscribersTable) @@ -135,7 +152,9 @@ fun dbCreateTables() { Pain001Table, EbicsSubscribersTable, EbicsAccountsInfoTable, - EbicsRawBankTransactionsTable + EbicsRawBankTransactionsTable, + ValidTalerIncomingPayments, + InvalidTalerIncomingPayments ) } } \ No newline at end of file diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt @@ -484,7 +484,7 @@ fun main() { } /** - * list all the payments related to customer {id} + * list all the prepared payments related to customer {id} */ get("/ebics/subscribers/{id}/payments") { @@ -642,6 +642,17 @@ fun main() { return@get } + + /** + * VERY taler-related behaviour, where the Nexus differentiates good + * incoming transactions (those with a valid subject, i.e. a public key), + * and invalid ones (the rest). + */ + post("/ebics/admin/digest-incoming-transactions") { + + } + + post("/ebics/subscribers/{id}/collect-transactions-c53") { val id = expectId(call.parameters["id"]) val paramsJson = call.receive<EbicsStandardOrderParamsJson>()