gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated (6024130a -> 8e54274d)


From: gnunet
Subject: [libeufin] branch master updated (6024130a -> 8e54274d)
Date: Thu, 26 Oct 2023 18:35:25 +0200

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

ms pushed a change to branch master
in repository libeufin.

    from 6024130a Remove unused columns, fix account creation and other 
improvements
     new 0a176158 nexus: implementing --check-full-config
     new 8e54274d nexus: fixing EBICS upload and testing with PoFi.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/kotlin/tech/libeufin/nexus/EbicsSetup.kt  | 15 +++++-
 nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt  |  2 +-
 .../kotlin/tech/libeufin/nexus/ebics/Ebics3.kt     |  2 +-
 .../tech/libeufin/nexus/ebics/EbicsCommon.kt       |  2 +-
 nexus/src/test/kotlin/PostFinance.kt               | 31 +++++++----
 nexus/src/test/kotlin/pain001.xml                  | 63 ----------------------
 util/src/main/kotlin/Ebics.kt                      |  1 +
 7 files changed, 38 insertions(+), 78 deletions(-)
 delete mode 100644 nexus/src/test/kotlin/pain001.xml

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsSetup.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsSetup.kt
index 95a5bf25..f50d9aec 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsSetup.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsSetup.kt
@@ -428,7 +428,20 @@ class EbicsSetup: CliktCommand("Set up the EBICS 
subscriber") {
     override fun run() {
         val cfg = extractEbicsConfig(this.configFile)
         if (checkFullConfig) {
-            throw NotImplementedError("--check-full-config flag not 
implemented")
+            doOrFail {
+                cfg.config.requireString("nexus-ebics-submit", "frequency")
+                cfg.config.requireString("nexus-ebics-fetch", "frequency")
+                cfg.config.requireString("nexus-ebics-fetch", 
"statement-log-directory")
+                cfg.config.requireString("nexus-httpd", "port")
+                cfg.config.requireString("nexus-httpd", "unixpath")
+                cfg.config.requireString("nexus-httpd", "serve")
+                cfg.config.requireString("nexus-httpd-wire-gateway-facade", 
"enabled")
+                cfg.config.requireString("nexus-httpd-wire-gateway-facade", 
"auth_method")
+                cfg.config.requireString("nexus-httpd-wire-gateway-facade", 
"auth_token")
+                cfg.config.requireString("nexus-httpd-revenue-facade", 
"enabled")
+                cfg.config.requireString("nexus-httpd-revenue-facade", 
"auth_method")
+                cfg.config.requireString("nexus-httpd-revenue-facade", 
"auth_token")
+            }
         }
         // Config is sane.  Go (maybe) making the private keys.
         val privsMaybe = preparePrivateKeys(cfg.clientPrivateKeysFilename)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
index 3c2b9e0a..537a9b29 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
@@ -65,7 +65,7 @@ val myJson = Json {
  * If even one of the fields could not be instantiated, then
  * throws TalerConfigError.
  */
-class EbicsSetupConfig(config: TalerConfig) {
+class EbicsSetupConfig(val config: TalerConfig) {
     // abstracts the section name.
     private val ebicsSetupRequireString = { option: String ->
         config.requireString("nexus-ebics", option)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/Ebics3.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/Ebics3.kt
index 7bd34a9a..85ed8b6e 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/Ebics3.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/Ebics3.kt
@@ -83,7 +83,7 @@ fun createEbics3RequestForUploadTransferPhase(
         cfg.ebicsHostId,
         transactionId,
         BigInteger.valueOf(chunkIndex.toLong()),
-        uploadData.encryptedPayloadChunks[chunkIndex]
+        uploadData.encryptedPayloadChunks[chunkIndex - 1]
     )
     val doc = XMLUtil.convertJaxbToDocument(req)
     XMLUtil.signEbicsDocument(
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsCommon.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsCommon.kt
index 3609c72d..a10dcbcf 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsCommon.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsCommon.kt
@@ -504,7 +504,7 @@ suspend fun doEbicsUpload(
         client,
         cfg,
         bankKeys,
-        initXml,
+        transferXml,
         isEbics3 = true
     )
     if (transferResp == null) {
diff --git a/nexus/src/test/kotlin/PostFinance.kt 
b/nexus/src/test/kotlin/PostFinance.kt
index cf604ec6..0a04711c 100644
--- a/nexus/src/test/kotlin/PostFinance.kt
+++ b/nexus/src/test/kotlin/PostFinance.kt
@@ -4,6 +4,7 @@ import org.junit.Ignore
 import org.junit.Test
 import tech.libeufin.nexus.*
 import tech.libeufin.nexus.ebics.fetchBankAccounts
+import tech.libeufin.nexus.ebics.submitPayment
 import tech.libeufin.util.IbanPayto
 import tech.libeufin.util.parsePayto
 import java.io.File
@@ -14,32 +15,40 @@ import java.time.format.DateTimeFormatter
 import kotlin.test.assertNotNull
 import kotlin.test.assertTrue
 
+private fun prep(): EbicsSetupConfig {
+    val handle = TalerConfig(NEXUS_CONFIG_SOURCE)
+    val ebicsUserId = File("/tmp/pofi-ebics-user-id.txt").readText()
+    val ebicsPartnerId = File("/tmp/pofi-ebics-partner-id.txt").readText()
+    handle.loadFromString(getPofiConfig(ebicsUserId, ebicsPartnerId))
+    return EbicsSetupConfig(handle)
+}
+
 class Iso20022 {
     @Test
     fun sendPayment() {
+        val cfg = prep()
         val xml = createPain001(
             "random",
             Instant.now(),
             
parsePayto("payto://iban/POFICHBE/CH9789144829733648596?receiver-name=NotGiven")!!,
             TalerAmount(4, 0, "CHF"),
-            "Test reimbursement",
+            "Test reimbursement, part 2",
             
parsePayto("payto://iban/CH9300762011623852957?receiver-name=NotGiven")!!
         )
-        println(xml)
-        File("/tmp/pain.001-test.xml").writeText(xml)
+        runBlocking {
+            submitPayment(
+                xml,
+                cfg,
+                loadPrivateKeysFromDisk(cfg.clientPrivateKeysFilename)!!,
+                loadBankKeys(cfg.bankPublicKeysFilename)!!,
+                HttpClient()
+            )
+        }
     }
 }
 
 @Ignore
 class PostFinance {
-    private fun prep(): EbicsSetupConfig {
-        val handle = TalerConfig(NEXUS_CONFIG_SOURCE)
-        val ebicsUserId = File("/tmp/pofi-ebics-user-id.txt").readText()
-        val ebicsPartnerId = File("/tmp/pofi-ebics-partner-id.txt").readText()
-        handle.loadFromString(getPofiConfig(ebicsUserId, ebicsPartnerId))
-        return EbicsSetupConfig(handle)
-    }
-
     // Tests sending client keys to the PostFinance test platform.
     @Test
     fun postClientKeys() {
diff --git a/nexus/src/test/kotlin/pain001.xml 
b/nexus/src/test/kotlin/pain001.xml
deleted file mode 100644
index 4fd0eba8..00000000
--- a/nexus/src/test/kotlin/pain001.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.09" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.001.09 
pain.001.001.09.ch.03.xsd">
-    <CstmrCdtTrfInitn>
-        <GrpHdr>
-            <MsgId>random</MsgId>
-            <CreDtTm>2023-10-26T12:54:13.423443377Z</CreDtTm>
-            <NbOfTxs>1</NbOfTxs>
-            <CtrlSum>TalerAmount(value=4, fraction=0, currency=CHF)</CtrlSum>
-            <InitgPty>
-                <Nm>Marcello Stanisci</Nm>
-            </InitgPty>
-        </GrpHdr>
-        <PmtInf>
-            <PmtInfId>NOT GIVEN</PmtInfId>
-            <PmtMtd>TRF</PmtMtd>
-            <BtchBookg>true</BtchBookg>
-            <NbOfTxs>1</NbOfTxs>
-            <CtrlSum>TalerAmount(value=4, fraction=0, currency=CHF)</CtrlSum>
-            <PmtTpInf>
-                <SvcLvl>
-                    <Cd>SDVA</Cd>
-                </SvcLvl>
-            </PmtTpInf>
-            <ReqdExctnDt>2023-10-26Z</ReqdExctnDt>
-            <Dbtr>
-                <Nm>Marcello Stanisci</Nm>
-            </Dbtr>
-            <DbtrAcct>
-                <Id>
-                    <IBAN>not-used-yet</IBAN>
-                </Id>
-            </DbtrAcct>
-            <DbtrAgt>
-                <FinInstnId>
-                    <BICFI>POFICHBE</BICFI>
-                </FinInstnId>
-            </DbtrAgt>
-            <ChrgBr>SLEV</ChrgBr>
-            <CdtTrfTxInf>
-                <PmtId>
-                    <InstrId>NOT PROVIDED</InstrId>
-                    <EndToEndId>NOT PROVIDED</EndToEndId>
-                </PmtId>
-                <Amt>
-                    <InstdAmt Ccy="CHF">4</InstdAmt>
-                </Amt>
-                <CdtrAgt>
-                    <FinInstnId>
-                        <BICFI>BIC</BICFI>
-                    </FinInstnId>
-                </CdtrAgt>
-                <CdtrAcct>
-                    <Id>
-                        <IBAN>INVALID</IBAN>
-                    </Id>
-                </CdtrAcct>
-                <RmtInf>
-                    <Ustrd>Test reimbursement</Ustrd>
-                </RmtInf>
-            </CdtTrfTxInf>
-        </PmtInf>
-    </CstmrCdtTrfInitn>
-</Document>
\ No newline at end of file
diff --git a/util/src/main/kotlin/Ebics.kt b/util/src/main/kotlin/Ebics.kt
index 5c295962..63bcc4d9 100644
--- a/util/src/main/kotlin/Ebics.kt
+++ b/util/src/main/kotlin/Ebics.kt
@@ -496,6 +496,7 @@ enum class EbicsReturnCode(val errorCode: String) {
     EBICS_AMOUNT_CHECK_FAILED("091303"),
     EBICS_EBICS_AUTHORISATION_ORDER_IDENTIFIER_FAILED("090003"),
     EBICS_INVALID_XML("091010"),
+    EBICS_TX_MESSAGE_REPLAY("091103"),
     EBICS_NO_DOWNLOAD_DATA_AVAILABLE("090005");
 
     companion object {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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