merchant

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

commit f8ad8bb28b419b812d8ea66ef874a4131e446dc4
parent a5c27744fb269c108e3e4f8e9fa29e51403dd4c8
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Sat, 17 Jan 2026 12:27:58 +0100

fix some ECs, WiP on templates

Diffstat:
Msrc/backend/taler-merchant-httpd_post-using-templates.c | 38+++++++++++++++++---------------------
1 file changed, 17 insertions(+), 21 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_post-using-templates.c b/src/backend/taler-merchant-httpd_post-using-templates.c @@ -515,17 +515,6 @@ parse_using_templates_inventory_request ( uc->parse_request.inventory.items_len, item); } -#if FIXME_PERMIT_ONLY_TIPPING - if (0 == uc->parse_request.inventory.items_len) - { - GNUNET_break_op (0); - use_reply_with_error (uc, - MHD_HTTP_BAD_REQUEST, - TALER_EC_GENERIC_PARAMETER_MISSING, - "inventory_selection"); - return GNUNET_SYSERR; - } -#endif return GNUNET_OK; } @@ -1504,17 +1493,24 @@ handle_phase_check_tip (struct UseContext *uc) static void handle_phase_check_total (struct UseContext *uc) { - // FIXME: not quite right if we do not have compute_price total! - if (! uc->parse_request.no_amount && - (0 != TALER_amount_cmp (&uc->parse_request.amount, - &uc->compute_price.totals[0]))) + GNUNET_assert (1 <= uc->compute_price.totals_len); + if (! uc->parse_request.no_amount) { - GNUNET_break_op (0); - use_reply_with_error (uc, - MHD_HTTP_CONFLICT, - TALER_EC_MERCHANT_POST_USING_TEMPLATES_AMOUNT_CONFLICT_TEMPLATES_CONTRACT_AMOUNT, - NULL); - return; + GNUNET_assert (1 == uc->compute_price.totals_len); + GNUNET_assert (GNUNET_YES == + TALER_amount_cmp_currency (&uc->parse_request.amount, + &uc->compute_price.totals[0])); + if (0 != + TALER_amount_cmp (&uc->parse_request.amount, + &uc->compute_price.totals[0])) + { + GNUNET_break_op (0); + use_reply_with_error (uc, + MHD_HTTP_CONFLICT, + TALER_EC_MERCHANT_POST_USING_TEMPLATES_AMOUNT_CONFLICT_TEMPLATES_CONTRACT_AMOUNT, + TALER_amount2s (&uc->compute_price.totals[0])); + return; + } } uc->phase++; }