libeufin

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

commit fc3f9450ad4c21964684f3e6a0a4b3eacbb98a8e
parent 7cab2765328f4ad6e8eb4160b829705c535a7b12
Author: Antoine A <>
Date:   Mon, 26 May 2025 16:24:45 +0200

nexus: skip zero transactions charges

Diffstat:
Mnexus/sample/platform/maerki_baumann_camt053.xml | 9+++++++++
Mnexus/src/main/kotlin/tech/libeufin/nexus/iso20022/camt.kt | 4++--
2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/nexus/sample/platform/maerki_baumann_camt053.xml b/nexus/sample/platform/maerki_baumann_camt053.xml @@ -73,6 +73,15 @@ </Tp> <Br>CRED</Br> </Rcrd> + <Rcrd> + <Amt Ccy="CHF">0</Amt> + <CdtDbtInd>CRDT</CdtDbtInd> + <Tp> + <Prtry> + <Id>SHAR</Id> + </Prtry> + </Tp> + </Rcrd> </Chrgs> <RltdPties> <Dbtr> diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/iso20022/camt.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/iso20022/camt.kt @@ -390,8 +390,8 @@ private fun XmlDestructor.complexAmount(): ComplexAmount? { var creditFee: TalerAmount? = null opt("Chrgs")?.each("Rcrd") { - if (one("ChrgInclInd").bool() && one("CdtDbtInd").text() == "DBIT" ) { - val amount = amount() + val amount = amount() + if (!amount.isZero() && one("ChrgInclInd").bool() && one("CdtDbtInd").text() == "DBIT") { creditFee = creditFee?.let { it + amount } ?: amount } }