merchant

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

commit cd3de6fb48be6f7edbb5158096b4c84658e36141
parent fa992ecadd63ffc1ce4d2b1b837970a3508954a3
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon,  5 Jan 2026 12:09:32 +0100

more issues fixed from rebase to master

Diffstat:
Msrc/backend/taler-merchant-httpd_helper.c | 34----------------------------------
Msrc/backend/taler-merchant-httpd_post-using-templates.c | 28++++++++++++++++------------
2 files changed, 16 insertions(+), 46 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_helper.c b/src/backend/taler-merchant-httpd_helper.c @@ -734,40 +734,6 @@ TMH_unit_set_clear (struct TMH_UnitSet *set) } -bool -TMH_taxes_array_valid (const json_t *taxes) -{ - json_t *tax; - size_t idx; - - if (! json_is_array (taxes)) - return false; - json_array_foreach (taxes, idx, tax) - { - struct TALER_Amount amount; - const char *name; - struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_string ("name", - &name), - TALER_JSON_spec_amount_any ("tax", - &amount), - GNUNET_JSON_spec_end () - }; - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_json_data (NULL, - tax, - spec); - if (GNUNET_OK != res) - { - GNUNET_break_op (0); - return false; - } - } - return true; -} - - struct TMH_WireMethod * TMH_setup_wire_account ( struct TALER_FullPayto payto_uri, diff --git a/src/backend/taler-merchant-httpd_post-using-templates.c b/src/backend/taler-merchant-httpd_post-using-templates.c @@ -142,7 +142,7 @@ categories_selected (const json_t *selected_categories, * * @param unit_price price per unit * @param quantity integer quantity - * @param quantity_frac fractional quantity (0..MERCHANT_UNIT_FRAC_BASE-1) + * @param quantity_frac fractional quantity (0..TALER_MERCHANT_UNIT_FRAC_BASE-1) * @param[out] line_total resulting line total * @return #GNUNET_OK on success */ @@ -177,7 +177,7 @@ compute_line_total (const struct TALER_Amount *unit_price, return GNUNET_SYSERR; TALER_amount_divide (&tmp, &tmp, - MERCHANT_UNIT_FRAC_BASE); + TALER_MERCHANT_UNIT_FRAC_BASE); if (0 > TALER_amount_add (line_total, line_total, @@ -455,15 +455,16 @@ handle_using_templates_inventory (struct MHD_Connection *connection, } if (GNUNET_OK != - TMH_process_quantity_inputs (TMH_VK_QUANTITY, - pd.allow_fractional_quantity, - true, - 0, - false, - quantity, - &quantity_value, - &quantity_frac, - &eparam)) + TALER_MERCHANT_vk_process_quantity_inputs ( + TMH_VK_QUANTITY, + pd.allow_fractional_quantity, + true, + 0, + false, + quantity, + &quantity_value, + &quantity_frac, + &eparam)) { GNUNET_JSON_parse_free (spec); json_decref (inventory_products); @@ -476,8 +477,11 @@ handle_using_templates_inventory (struct MHD_Connection *connection, eparam); } + // FIXME: this was pd.price, which no longer exists. + // Bad hack, will not really work, need to properly + // support an *array* of prices here! if (GNUNET_OK != - compute_line_total (&pd.price, + compute_line_total (&pd.price_array[0], quantity_value, quantity_frac, &line_total))