summaryrefslogtreecommitdiff
path: root/nexus
diff options
context:
space:
mode:
authorMS <ms@taler.net>2021-02-04 19:13:06 +0100
committerMS <ms@taler.net>2021-02-04 19:13:06 +0100
commit756578d76e643edac693f932ad102d079e8d25dc (patch)
tree470498e89af1874701cf79f967946c1e62677fc2 /nexus
parent2ae476cfb5073d61005ce15d0c317e11d26e588d (diff)
downloadlibeufin-756578d76e643edac693f932ad102d079e8d25dc.tar.gz
libeufin-756578d76e643edac693f932ad102d079e8d25dc.tar.bz2
libeufin-756578d76e643edac693f932ad102d079e8d25dc.zip
refund extra check
Diffstat (limited to 'nexus')
-rw-r--r--nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt8
1 files changed, 4 insertions, 4 deletions
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt
index ad69951e..fbb58825 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt
@@ -448,10 +448,10 @@ fun prepareRefunds() {
}
// FIXME: investigate this amount!
val amount = paymentData.batches[0].batchTransactions[0].amount
- if (amount == null) {
- logger.error("Could not find the amount to refund for transaction (AcctSvcrRef): ${paymentData.accountServicerRef}, aborting refund")
- throw NexusError(HttpStatusCode.InternalServerError, "Amount to refund not found")
- }
+ NexusAssert(
+ it.payment.creditDebitIndicator == "CRDT",
+ "Cannot refund a _outgoing_ payment!"
+ )
// FIXME: the amount to refund should be reduced, according to the refund fees.
addPaymentInitiation(
Pain001Data(