[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: Finding outgoing payments in Camt ONLY
From: |
gnunet |
Subject: |
[libeufin] branch master updated: Finding outgoing payments in Camt ONLY based on PmtInfId. |
Date: |
Tue, 19 Jan 2021 00:11:57 +0100 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new d48d5c5 Finding outgoing payments in Camt ONLY based on PmtInfId.
d48d5c5 is described below
commit d48d5c51730dc7fe4fd957a8e72e89e378741a71
Author: MS <ms@taler.net>
AuthorDate: Tue Jan 19 00:09:59 2021 +0100
Finding outgoing payments in Camt ONLY based on PmtInfId.
---
nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt | 4 ++--
.../kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt | 12 +++++-------
.../src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt | 4 ++--
.../src/main/kotlin/tech/libeufin/nexus/iso20022/Iso20022.kt | 3 ---
4 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
index 8871412..26bf554 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
@@ -172,7 +172,6 @@ object PaymentInitiationsTable : LongIdTable() {
val sum = amount("sum")
val currency = varchar("currency", length = 3).default("EUR")
val endToEndId = text("endToEndId")
- val messageId = text("messageId")
val paymentInformationId = text("paymentInformationId")
val instructionId = text("instructionId")
val subject = text("subject")
@@ -180,6 +179,7 @@ object PaymentInitiationsTable : LongIdTable() {
val creditorBic = text("creditorBic").nullable()
val creditorName = text("creditorName")
val submitted = bool("submitted").default(false)
+ val messageId = text("messageId")
/**
* Points at the raw transaction witnessing that this
@@ -203,8 +203,8 @@ class PaymentInitiationEntity(id: EntityID<Long>) :
LongEntity(id) {
var creditorName by PaymentInitiationsTable.creditorName
var submitted by PaymentInitiationsTable.submitted
var paymentInformationId by PaymentInitiationsTable.paymentInformationId
- var messageId by PaymentInitiationsTable.messageId
var instructionId by PaymentInitiationsTable.instructionId
+ var messageId by PaymentInitiationsTable.messageId
var confirmationTransaction by NexusBankTransactionEntity
optionalReferencedOn PaymentInitiationsTable.confirmationTransaction
}
diff --git
a/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt
index 542e237..84bdd83 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt
@@ -182,17 +182,15 @@ fun processCamtMessage(bankAccountId: String, camtDoc:
Document, code: String):
// This block tries to acknowledge a former outgoing payment as
booked.
if (singletonBatchedTransaction.creditDebitIndicator ==
CreditDebitIndicator.DBIT) {
val t0 = singletonBatchedTransaction.details
- val msgId = t0.messageId
val pmtInfId = t0.paymentInformationId
- if (msgId != null && pmtInfId != null) {
+ if (pmtInfId != null) {
val paymentInitiation = PaymentInitiationEntity.find {
- (PaymentInitiationsTable.messageId eq msgId) and
- (PaymentInitiationsTable.bankAccount eq
acct.id) and
- (PaymentInitiationsTable.paymentInformationId
eq pmtInfId)
+ PaymentInitiationsTable.bankAccount eq acct.id and (
+ PaymentInitiationsTable.paymentInformationId
eq pmtInfId)
}.firstOrNull()
if (paymentInitiation != null) {
- logger.info("Could confirm one initiated payment:
$msgId")
+ logger.info("Could confirm one initiated payment:
$pmtInfId")
paymentInitiation.confirmationTransaction = rawEntity
}
}
@@ -271,8 +269,8 @@ fun addPaymentInitiation(paymentData: Pain001Data,
debitorAccount: NexusBankAcco
creditorBic = paymentData.creditorBic
creditorIban = paymentData.creditorIban
preparationDate = now
- messageId = "leuf-mp1-$nowHex-$painHex-$acctHex"
endToEndId = "leuf-e-$nowHex-$painHex-$acctHex"
+ messageId = "leuf-mp1-$nowHex-$painHex-$acctHex"
paymentInformationId = "leuf-p-$nowHex-$painHex-$acctHex"
instructionId = "leuf-i-$nowHex-$painHex-$acctHex"
}
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
index 5e6fc65..cedf91e 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
@@ -765,12 +765,12 @@ suspend fun submitEbicsPaymentInitiation(httpClient:
HttpClient, paymentInitiati
creditorIban = paymentInitiation.creditorIban,
creditorName = paymentInitiation.creditorName,
creditorBic = paymentInitiation.creditorBic,
- messageId = paymentInitiation.messageId,
paymentInformationId = paymentInitiation.paymentInformationId,
preparationTimestamp = paymentInitiation.preparationDate,
subject = paymentInitiation.subject,
instructionId = paymentInitiation.instructionId,
- endToEndId = paymentInitiation.endToEndId
+ endToEndId = paymentInitiation.endToEndId,
+ messageId = paymentInitiation.messageId
)
)
if (!XMLUtil.validateFromString(painMessage)) throw NexusError(
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/iso20022/Iso20022.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/iso20022/Iso20022.kt
index 8b0ce13..182738c 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/iso20022/Iso20022.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/iso20022/Iso20022.kt
@@ -712,9 +712,6 @@ private fun XmlElementDestructor.extractTransactionDetails(
endToEndId = maybeUniqueChildNamed("Refs") {
maybeUniqueChildNamed("EndToEndId") { focusElement.textContent }
},
- messageId = maybeUniqueChildNamed("Refs") {
- maybeUniqueChildNamed("MsgId") { focusElement.textContent }
- },
paymentInformationId = maybeUniqueChildNamed("Refs") {
maybeUniqueChildNamed("PmtInfId") { focusElement.textContent }
},
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: Finding outgoing payments in Camt ONLY based on PmtInfId.,
gnunet <=