summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_private-get-orders.c
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2023-10-13 20:51:04 +0200
committerChristian Grothoff <grothoff@gnunet.org>2023-10-13 21:16:50 +0200
commit0f3490dc022620c7e42b86426e14198a04c2e17f (patch)
tree0b16661ae6aa9273bf81652fe6a8806060b31fb0 /src/backend/taler-merchant-httpd_private-get-orders.c
parenta5f50083e65a3e9a0945b150701349afa81a0e9e (diff)
downloadmerchant-0f3490dc022620c7e42b86426e14198a04c2e17f.tar.gz
merchant-0f3490dc022620c7e42b86426e14198a04c2e17f.tar.bz2
merchant-0f3490dc022620c7e42b86426e14198a04c2e17f.zip
more work on multicurrency support: use checks everywhere...
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-get-orders.c')
-rw-r--r--src/backend/taler-merchant-httpd_private-get-orders.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/backend/taler-merchant-httpd_private-get-orders.c b/src/backend/taler-merchant-httpd_private-get-orders.c
index 3b8f8c34..0e0511cc 100644
--- a/src/backend/taler-merchant-httpd_private-get-orders.c
+++ b/src/backend/taler-merchant-httpd_private-get-orders.c
@@ -251,6 +251,16 @@ process_refunds_cb (void *cls,
{
struct TALER_Amount *total_refund_amount = cls;
+ if (GNUNET_OK !=
+ TALER_amount_cmp_currency (total_refund_amount,
+ refund_amount))
+ {
+ /* Database error, refunds in mixed currency in DB. Not OK! */
+ /* FIXME: we may want to return DB error to the client instead of just
+ ignoring the refund. */
+ GNUNET_break (0);
+ return;
+ }
GNUNET_assert (0 <=
TALER_amount_add (total_refund_amount,
total_refund_amount,
@@ -387,7 +397,6 @@ add_order (void *cls,
{
struct TALER_Amount refund_amount;
- /* FIXME: #7951 */
GNUNET_assert (GNUNET_OK ==
TALER_amount_set_zero (order_amount.currency,
&refund_amount));