merchant

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

commit 9f4283e61b44f33351f979dea74a1bd73cb50e82
parent 245a7eb5b63bdc18ab1b41738d5ba12884afc7e0
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 21 Jul 2021 18:01:17 +0200

-add missing currency check

Diffstat:
Msrc/backend/taler-merchant-httpd_private-post-reserves-ID-authorize-tip.c | 12++++++++++++
Msrc/testing/test_merchant_api.c | 2+-
2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/backend/taler-merchant-httpd_private-post-reserves-ID-authorize-tip.c b/src/backend/taler-merchant-httpd_private-post-reserves-ID-authorize-tip.c @@ -69,6 +69,18 @@ authorize_tip (const struct TMH_RequestHandler *rh, : MHD_NO; } } + + if (0 != + strcasecmp (amount.currency, + TMH_currency)) + { + GNUNET_break_op (0); + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_CONFLICT, + TALER_EC_GENERIC_CURRENCY_MISMATCH, + TMH_currency); + } + TMH_db->preflight (TMH_db->cls); ec = TMH_db->authorize_tip (TMH_db->cls, hc->instance->settings.id, diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c @@ -153,7 +153,7 @@ const char *order_1_forgets_3[] = { * @param label label to use for the command. */ static struct TALER_TESTING_Command -cmd_exec_wirewatch (char *label) +cmd_exec_wirewatch (const char *label) { return TALER_TESTING_cmd_exec_wirewatch (label, CONFIG_FILE); }