commit 57fef96fde68159fa2035f849da78e059e5034f7 parent f131cb634d98aa1c149d0661a1e4eb58e9008a29 Author: Marcello Stanisci <stanisci.m@gmail.com> Date: Wed, 4 Mar 2020 16:31:42 +0100 fix bank account to customer mapping Diffstat:
| M | nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | | | 5 | +++-- |
| M | sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | | | 1 | - |
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt @@ -126,8 +126,9 @@ fun getBankAccountDetailsFromAcctid(id: String): EbicsAccountInfoElement { } fun getSubscriberDetailsFromBankAccount(bankAccountId: String): EbicsClientSubscriberDetails { return transaction { - val subscriber = EbicsAccountInfoEntity.findById(bankAccountId) ?: throw SubscriberNotFoundError(HttpStatusCode.NotFound) - getSubscriberDetailsFromId(subscriber.id.value) + val accountInfo = EbicsAccountInfoEntity.findById(bankAccountId) ?: throw Exception("Bank account ($bankAccountId) not managed by Nexus") + logger.debug("Mapping bank account: ${bankAccountId}, to customer: ${accountInfo.subscriber.id.value}") + getSubscriberDetailsFromId(accountInfo.subscriber.id.value) } } diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt @@ -213,7 +213,6 @@ fun main() { install(CallLogging) { this.level = Level.DEBUG this.logger = LOGGER - } install(ContentNegotiation) { gson {