commit 4b47e468889379e97da465bbc13f9a7314d8c6f2
parent 8d841f8c99751590333c7f34ce96f51dcd9e27b6
Author: Florian Dold <florian.dold@gmail.com>
Date: Sat, 31 Aug 2019 14:07:54 +0200
subtract refund after checking for fee coverage
Diffstat:
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
@@ -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;
}