diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-08-31 14:07:54 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-08-31 14:07:54 +0200 |
commit | 4b47e468889379e97da465bbc13f9a7314d8c6f2 (patch) | |
tree | af315473727d0e285b9864ce23f7ffd622a36fdc /src/backend/taler-merchant-httpd_pay.c | |
parent | 8d841f8c99751590333c7f34ce96f51dcd9e27b6 (diff) | |
download | merchant-4b47e468889379e97da465bbc13f9a7314d8c6f2.tar.gz merchant-4b47e468889379e97da465bbc13f9a7314d8c6f2.tar.bz2 merchant-4b47e468889379e97da465bbc13f9a7314d8c6f2.zip |
subtract refund after checking for fee coverage
Diffstat (limited to 'src/backend/taler-merchant-httpd_pay.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_pay.c | 17 |
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; } |