libeufin

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

commit 196f7bf20acd57a530d174a4701e45933deb9b57
parent 9b0aafb5e814fbb4328392fbd28e80e04ca95a60
Author: MS <ms@taler.net>
Date:   Mon,  3 Apr 2023 01:33:27 +0200

comments, indentation, helpers

Diffstat:
Msandbox/src/main/kotlin/tech/libeufin/sandbox/XMLEbicsConverter.kt | 2+-
Mutil/src/main/kotlin/HTTP.kt | 8++++++++
Mutil/src/main/kotlin/JSON.kt | 5+++++
3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/XMLEbicsConverter.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/XMLEbicsConverter.kt @@ -54,7 +54,7 @@ class XMLEbicsConverter : ContentConverter { XMLUtil.convertJaxbToString(value) } catch (e: Exception) { /** - * Not always a error: the content negotiation might have + * Not always an error: the content negotiation might have * only checked if this handler could convert the response. */ return null diff --git a/util/src/main/kotlin/HTTP.kt b/util/src/main/kotlin/HTTP.kt @@ -26,6 +26,14 @@ fun notFound(msg: String): UtilError { ) } +fun badGateway(msg: String): UtilError { + return UtilError( + HttpStatusCode.BadGateway, + msg, + LibeufinErrorCode.LIBEUFIN_EC_NONE + ) +} + /** * Returns the token (including the 'secret-token:' prefix) * from a Authorization header. Throws exception on malformations diff --git a/util/src/main/kotlin/JSON.kt b/util/src/main/kotlin/JSON.kt @@ -51,6 +51,11 @@ enum class XLibeufinBankDirection(val direction: String) { } } } + fun exportAsCamtDirection(): String = + when(this) { + CREDIT -> "CRDT" + DEBIT -> "DBIT" + } } data class XLibeufinBankPaytoReq(