summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-08-31 14:07:54 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-08-31 14:07:54 +0200
commit4b47e468889379e97da465bbc13f9a7314d8c6f2 (patch)
treeaf315473727d0e285b9864ce23f7ffd622a36fdc
parent8d841f8c99751590333c7f34ce96f51dcd9e27b6 (diff)
downloadmerchant-4b47e468889379e97da465bbc13f9a7314d8c6f2.tar.gz
merchant-4b47e468889379e97da465bbc13f9a7314d8c6f2.tar.bz2
merchant-4b47e468889379e97da465bbc13f9a7314d8c6f2.zip
subtract refund after checking for fee coverage
-rw-r--r--src/backend/taler-merchant-httpd_pay.c17
1 files 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;
}