commit 756578d76e643edac693f932ad102d079e8d25dc parent 2ae476cfb5073d61005ce15d0c317e11d26e588d Author: MS <ms@taler.net> Date: Thu, 4 Feb 2021 19:13:06 +0100 refund extra check Diffstat:
| M | nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt | | | 8 | ++++---- |
1 file 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 @@ -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(