merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 3e295bc2facf85bdf7f1c4f2a1cbe984df510909
parent 3f6d32fb3cbad1981f96df6b92bb4de568c5fbe8
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Mon, 27 May 2019 15:51:41 +0200

5732.

Not en error, just the log level was set wrong.

Diffstat:
Msrc/backend/taler-merchant-httpd_refund.c | 3++-
Msrc/backenddb/plugin_merchantdb_postgres.c | 11+++++++----
2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_refund.c b/src/backend/taler-merchant-httpd_refund.c @@ -238,9 +238,10 @@ MH_handler_refund_increase (struct TMH_RequestHandler *rh, &mi->pubkey, &refund, reason); - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "increase refund returned %d\n", qs); + if (GNUNET_DB_STATUS_HARD_ERROR == qs) { GNUNET_break (0); diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c @@ -371,7 +371,6 @@ postgres_initialize (void *cls) "COMMIT", 0), - /*NOTE: minimal version, to be expanded on a needed basis*/ GNUNET_PQ_make_prepare ("find_refunds", "SELECT" " refund_amount_val" @@ -2634,7 +2633,9 @@ process_deposits_for_refund_cb (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Total existing refund is %s\n", TALER_amount2s (&current_refund)); - /* stop immediately if we are done */ + + /* stop immediately if we are 'done' === amount already + * refunded. */ if (0 >= TALER_amount_cmp (ctx->refund, &current_refund)) { @@ -2670,7 +2671,7 @@ process_deposits_for_refund_cb (void *cls, continue; } - /* How much of the refund is left? */ + /* How much of the refund is still to be paid back? */ if (GNUNET_SYSERR == TALER_amount_subtract (&remaining_refund, ctx->refund, @@ -2729,6 +2730,7 @@ process_deposits_for_refund_cb (void *cls, return; } } + /* stop immediately if we are done */ if (0 == TALER_amount_cmp (ctx->refund, &current_refund)) @@ -2736,7 +2738,7 @@ process_deposits_for_refund_cb (void *cls, } /** - * We end up here if nto all of the refund has been covered. + * We end up here if not all of the refund has been covered. * Although this should be checked as the business should never * issue a refund bigger than the contract's actual price, we cannot * rely upon the frontend being correct. @@ -2744,6 +2746,7 @@ process_deposits_for_refund_cb (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "The refund of %s is bigger than the order's value\n", TALER_amount2s (ctx->refund)); + ctx->qs = GNUNET_DB_STATUS_HARD_ERROR; }