libeufin

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

commit 593880f7767f54b232607469f82c8d0e302f7199
parent 2b8ec7e78dabe0112e13ad5e50cfbe27f1460119
Author: MS <ms@taler.net>
Date:   Tue,  9 Jun 2020 13:59:59 +0200

Outgoing payments ingestion.

no need to throw errors if a outgoing payment
was never requested via the Taler facade.  This
is completely fine to happen, if e.g. one payment
(that involved the exchange bank account) is
performed using some facade-agnostic UI app.

Diffstat:
Mnexus/src/main/kotlin/tech/libeufin/nexus/taler.kt | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt @@ -461,12 +461,13 @@ fun ingestTalerTransactions() { // Outgoing payment if (it.transactionType == "DBIT") { logger.debug("Ingesting outgoing payment: ${it.unstructuredRemittanceInformation}") - var talerRequested = TalerRequestedPaymentEntity.find { + val talerRequested = TalerRequestedPaymentEntity.find { TalerRequestedPayments.wtid eq it.unstructuredRemittanceInformation - }.firstOrNull() ?: throw NexusError( - HttpStatusCode.InternalServerError, - "Payment '${it.unstructuredRemittanceInformation}' shows in history, but was never requested!" - ) + }.firstOrNull() + if (talerRequested == null){ + logger.info("Payment '${it.unstructuredRemittanceInformation}' shows in history, but was never requested!") + return@forEach + } logger.debug("Payment: ${it.unstructuredRemittanceInformation} was requested, and gets now marked as 'confirmed'") talerRequested.rawConfirmed = it }