commit ac0af1ac7b8854800cd12cdaa2ed8dc99e862737
parent 7eb8e4cccdbafc248278199e85949a1ba63bb268
Author: MS <ms@taler.net>
Date: Wed, 10 Jun 2020 16:42:37 +0200
subject normalizer skeleton
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt
@@ -221,6 +221,12 @@ fun paymentFailed(entry: RawBankTransactionEntity): Boolean {
return false
}
+// Tries to extract a valid PUB from the raw subject
+// line, as that was communicated by the originating bank.
+fun normalizeSubject(rawSubject: String): String {
+ return rawSubject
+}
+
fun getTalerFacadeState(fcid: String): TalerFacadeStateEntity {
val facade = FacadeEntity.find { FacadesTable.id eq fcid }.firstOrNull() ?: throw NexusError(
HttpStatusCode.NotFound,
@@ -446,6 +452,7 @@ fun ingestTalerTransactions() {
}.orderBy(Pair(RawBankTransactionsTable.id, SortOrder.ASC)).forEach {
// Incoming payment.
if (it.transactionType == "CRDT") {
+ val normalizedSubject = normalizeSubject(it.unstructuredRemittanceInformation)
if (CryptoUtil.checkValidEddsaPublicKey(it.unstructuredRemittanceInformation)) {
TalerIncomingPaymentEntity.new {
payment = it