gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] 01/03: Drafting PAIN generation.


From: gnunet
Subject: [libeufin] 01/03: Drafting PAIN generation.
Date: Wed, 26 Feb 2020 15:58:06 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository libeufin.

commit 59a4eedf7c05c8e2d361a74f78d4e8645cbd544b
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Feb 26 13:01:43 2020 +0100

    Drafting PAIN generation.
---
 nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 93 +++++++++++++++++++++++
 1 file changed, 93 insertions(+)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
index 167030e..396f345 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
@@ -166,6 +166,96 @@ data class Pain001Data(
     val subject: String
 )
 
+/**
+ * Create a PAIN.001 XML document according to the input data.
+ * Needs to be called within a transaction block.
+ */
+fun createPain001document(pain001Data: Pain001Entity): String {
+    val s = constructXml(indent = true) {
+        root("Document") {
+            element("CstmrCdtTrfInitn") {
+                element("GrpHdr") {
+                    element("MsgId") {
+                        text("UNIQUE-VALUE")
+                    }
+                    element("CreDtTm") {
+                        text("DATE")
+                    }
+                    element("NbOfTxs") {
+                        text("1")
+                    }
+                    element("CtrlSum") {
+                        text("TOTAL SUM")
+                    }
+                    element("InitgPty/Nm") {
+                        text("BANK ACCOUNT ID")
+                    }
+                }
+                element("PmtInf") {
+                    element("PmtInfId") {
+                        text("PAYMENT-ID")
+                    }
+                    element("PmtMtd") {
+                        text("TRF")
+                    }
+                    element("BtchBookg") {
+                        text("true")
+                    }
+                    element("NbOfTxs") {
+                        text("1")
+                    }
+                    element("CtrlSum") {
+                        text("SUM")
+                    }
+                    element("PmtTpInf/SvcLvl/Cd") {
+                        text("SEPA")
+                    }
+                    element("ReqdExctnDt") {
+                        text("date when the clearing agent should process the 
payment")
+                    }
+                    element("Dbtr/Nm") {
+                        text("BANK ACCOUNT ID")
+                    }
+                    element("DbtrAcct/Id/IBAN") {
+                        text("IBAN")
+                    }
+                    element("DbtrAgt/FinInstnId/BIC") {
+                        text("bank international code")
+                    }
+                    element("ChrgBr") {
+                        text("SLEV")
+                    }
+                    element("CdtTrfTxInf") {
+                        element("PmtId") {
+                            element("EndToEndId") {
+                                text("xy")
+                            }
+                        }
+                        element("Amt/InstdAmt") {
+                            attribute("Ccy", "EUR")
+                            text("AMOUNT")
+                        }
+                        element("CdtrAgt/FinInstnId/BIC") {
+                            text("credit party bank's BIC")
+                        }
+                        element("Cdtr/Nm") {
+                            text("Credit party real name")
+                        }
+                        element("CdtrAcct/Id/IBAN") {
+                            text("Credit party IBAN")
+                        }
+                        element("RmtInf/Ustrd") {
+                            text("subject line")
+                        }
+                    }
+                }
+            }
+        }
+    }
+    
+    return s
+}
+
 /**
  * Insert one row in the database, and leaves it marked as non-submitted.
  */
@@ -365,6 +455,9 @@ fun main() {
                 return@get
             }
 
+            /* need primitive that crawls the database of pending payments and 
generates PAIN.001
+            * after those.  */
+
             post("/ebics/subscribers/{id}/accounts/{acctid}/prepare-payment") {
                 val acctid = expectId(call.parameters["acctid"])
                 val subscriberId = expectId(call.parameters["id"])

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]