commit 0698acd55d400bbc1da2eff9b3fa8491bf55e2fc
parent dee6d7b62215972e958a8a5e03242d11e22117b9
Author: MS <ms@taler.net>
Date: Thu, 14 May 2020 21:25:24 +0200
Fix XPath.
Diffstat:
3 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/integration-tests/test-ebics-new.py b/integration-tests/test-ebics-new.py
@@ -30,7 +30,8 @@ import base64
# 4 Verify that history is empty.
# 5 Issue a payment from Nexus
# -> (a) Prepare & (b) trigger CCT.
-# 6 Request history again, from Nexus to Bank.
+# 6 Request history after submitting the payment,
+# from Nexus to Bank.
# 7 Verify that previous payment shows up.
# Nexus user details
@@ -246,7 +247,7 @@ assertResponse(
)
)
-#3, request history to Nexus
+#3, ask nexus to download history
assertResponse(
post(
"http://localhost:5001/bank-accounts/collected-transactions",
@@ -293,24 +294,22 @@ assertResponse(
)
)
-nexus.terminate()
-sandbox.terminate()
-exit(44)
-
-#6
+#6, request history after payment submission
assertResponse(
post(
- "http://localhost:5001/ebics/subscribers/{}/collect-transactions-c53".format(USERNAME),
- json=dict()
+ "http://localhost:5001/bank-accounts/collected-transactions",
+ json=dict(),
+ headers=dict(Authorization=USER_AUTHORIZATION_HEADER)
)
)
resp = assertResponse(
get(
- "http://localhost:5001/users/{}/history".format(USERNAME)
+ "http://localhost:5001/bank-accounts/{}/collected-transactions".format(BANK_ACCOUNT_LABEL),
+ headers=dict(Authorization=USER_AUTHORIZATION_HEADER)
)
)
-assert(len(resp.json().get("payments")) == 1)
+assert(len(resp.json().get("transactions")) == 1)
nexus.terminate()
sandbox.terminate()
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Helpers.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Helpers.kt
@@ -195,7 +195,10 @@ suspend fun downloadAndPersistC5xEbics(
val camt53doc = XMLUtil.parseStringIntoDom(it.second)
transaction {
RawBankTransactionEntity.new {
- bankAccount = getBankAccountFromIban(camt53doc.pickString("//*[local-name()='Stmt']/Acct/Id/IBAN"))
+ bankAccount = getBankAccountFromIban(
+ camt53doc.pickString(
+ "//*[local-name()='Stmt']/*[local-name()='Acct']/*[local-name()='Id']/*[local-name()='IBAN']")
+ )
sourceFileName = fileName
unstructuredRemittanceInformation = camt53doc.pickString("//*[local-name()='Ntry']//*[local-name()='Ustrd']")
transactionType = camt53doc.pickString("//*[local-name()='Ntry']//*[local-name()='CdtDbtInd']")
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt
@@ -205,7 +205,7 @@ fun buildCamtString(type: Int, history: MutableList<RawPayment>): MutableList<St
element("Acct") {
// mandatory account identifier
element("Id/IBAN") {
- text("Owner IBAN")
+ text(it.debitorIban)
}
element("Ccy") {
text("EUR")