libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 8a49818dafb74a89e535c353d68e0424fc037d13
parent a741e1112f8411042705c4831fddc23a0d7dd141
Author: MS <ms@taler.net>
Date:   Fri,  4 Dec 2020 17:07:02 +0100

Get payments' integration tests to pass.

Diffstat:
Mnexus/src/main/kotlin/tech/libeufin/nexus/iso20022/Iso20022.kt | 10++++++----
Msandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt | 8++++----
2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/iso20022/Iso20022.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/iso20022/Iso20022.kt @@ -338,7 +338,7 @@ class CamtParsingError(msg: String) : Exception(msg) */ data class NexusPaymentInitiationData( val debtorIban: String, - val debtorBic: String?, + val debtorBic: String, val debtorName: String, val messageId: String, val paymentInformationId: String, @@ -429,9 +429,8 @@ fun createPain001document(paymentData: NexusPaymentInitiationData): String { element("DbtrAcct/Id/IBAN") { text(paymentData.debtorIban) } - when (val b = paymentData.debtorBic) { - null -> element("DbtrAgt/FinInstnId/Othr/Id") { text("NOTPROVIDED") } - else -> element("DbtrAgt/FinInstnId/BIC") { text(b) } + element("DbtrAgt/FinInstnId/BIC") { + text(paymentData.debtorBic) } element("ChrgBr") { text("SLEV") @@ -450,6 +449,9 @@ fun createPain001document(paymentData: NexusPaymentInitiationData): String { attribute("Ccy", paymentData.currency) text(paymentData.amount) } + element("CdtrAgt/FinInstnId/BIC") { + text(paymentData.creditorBic) + } element("Cdtr/Nm") { text(paymentData.creditorName) } diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt @@ -490,7 +490,7 @@ private fun parsePain001(paymentRequest: String, initiatorName: String): PainPar } } val debtorIban = requireUniqueChildNamed("DbtrAcct"){ - requireUniqueChildNamed("Type") { + requireUniqueChildNamed("Id") { requireUniqueChildNamed("IBAN") { focusElement.textContent } @@ -498,7 +498,7 @@ private fun parsePain001(paymentRequest: String, initiatorName: String): PainPar } val debtorBic = requireUniqueChildNamed("DbtrAgt"){ requireUniqueChildNamed("FinInstnId") { - requireUniqueChildNamed("BICFI") { + requireUniqueChildNamed("BIC") { focusElement.textContent } } @@ -517,8 +517,8 @@ private fun parsePain001(paymentRequest: String, initiatorName: String): PainPar } } val creditorBic = requireUniqueChildNamed("CdtrAgt") { - requireUniqueChildNamed("InstnId") { - requireUniqueChildNamed("BICFI") { + requireUniqueChildNamed("FinInstnId") { + requireUniqueChildNamed("BIC") { focusElement.textContent } }