From 4b47e468889379e97da465bbc13f9a7314d8c6f2 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sat, 31 Aug 2019 14:07:54 +0200 Subject: subtract refund after checking for fee coverage --- src/backend/taler-merchant-httpd_pay.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/backend/taler-merchant-httpd_pay.c b/src/backend/taler-merchant-httpd_pay.c index 3a6bde52..d381c7ee 100644 --- a/src/backend/taler-merchant-httpd_pay.c +++ b/src/backend/taler-merchant-httpd_pay.c @@ -733,14 +733,6 @@ check_payment_sufficient (struct PayContext *pc) &wire_fee_customer_contribution)); } - /* Do not count any refunds towards the payment */ - GNUNET_assert - (GNUNET_SYSERR != TALER_amount_subtract (&acc_amount, - &acc_amount, - &pc->total_refunded)); - GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Subtracting total refunds from paid amount: %s\n", - TALER_amount_to_string (&pc->total_refunded)); /** * Deposit fees of *all* the coins are higher than * the fixed limit that the merchant is willing to @@ -849,6 +841,15 @@ check_payment_sufficient (struct PayContext *pc) } } + /* Do not count any refunds towards the payment */ + GNUNET_assert + (GNUNET_SYSERR != TALER_amount_subtract (&acc_amount, + &acc_amount, + &pc->total_refunded)); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Subtracting total refunds from paid amount: %s\n", + TALER_amount_to_string (&pc->total_refunded)); + return TALER_EC_NONE; } -- cgit v1.2.3