merchant

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

commit 476b220f6df713ecc809cb80aec88bd5f9121ac6
parent ed040676c2410b1764e68f8ebb648d2c01c60e31
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon, 25 May 2026 23:46:28 +0200

more minor fixes

Diffstat:
Msrc/include/taler/taler_merchant_util.h | 6+++++-
Msrc/util/contract_parse.c | 4++--
Msrc/util/order_parse.c | 4++--
Msrc/util/template_parse.c | 5++++-
Msrc/util/token_family_parse.c | 6++++--
Msrc/util/token_family_serialize.c | 5+++--
6 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/src/include/taler/taler_merchant_util.h b/src/include/taler/taler_merchant_util.h @@ -637,6 +637,7 @@ struct TALER_MERCHANT_ContractChoice /** * Map from IETF BCP 47 language tags to localized description. + * Optional. */ json_t *description_i18n; @@ -699,6 +700,7 @@ struct TALER_MERCHANT_OrderChoice /** * Map from IETF BCP 47 language tags to localized description. + * Optional. */ json_t *description_i18n; @@ -782,6 +784,7 @@ struct TALER_MERCHANT_ContractTokenFamily /** * Map from IETF BCP 47 language tags to localized description. + * Optional. */ json_t *description_i18n; @@ -1986,7 +1989,8 @@ TALER_MERCHANT_json_from_token_family ( * @param valid_after validity start of the token family * @param[in] families array of token families in the contract terms * @param families_len length of @a families array - * @param[out] family matching token family; NULL if no result + * @param[out] family matching token family; NULL if no result; + * the pointer returned will be an alias into @e families * @param[out] key key of matching token family; NULL if no result * @return #GNUNET_SYSERR if no matching family found; #GNUNET_OK otherwise */ diff --git a/src/util/contract_parse.c b/src/util/contract_parse.c @@ -76,7 +76,7 @@ parse_contract_v0 ( { GNUNET_break (0); GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "'max_fee' in database does not match currency of contract price"); + "'max_fee' does not match currency of contract price"); return GNUNET_SYSERR; } if ( (! contract->details.v0.no_tip) && @@ -86,7 +86,7 @@ parse_contract_v0 ( { GNUNET_break (0); GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "'tip' in database does not match currency of contract price"); + "'tip' does not match currency of contract price"); return GNUNET_SYSERR; } diff --git a/src/util/order_parse.c b/src/util/order_parse.c @@ -79,7 +79,7 @@ parse_order_v0 ( { GNUNET_break (0); GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "'max_fee' in database does not match currency of order price"); + "'max_fee' does not match currency of order price"); return GNUNET_SYSERR; } if ( (! order->details.v0.no_tip) && @@ -89,7 +89,7 @@ parse_order_v0 ( { GNUNET_break (0); GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "'tip' in database does not match currency of order price"); + "'tip' does not match currency of order price"); return GNUNET_SYSERR; } diff --git a/src/util/template_parse.c b/src/util/template_parse.c @@ -41,7 +41,10 @@ TALER_MERCHANT_template_type_from_contract (const json_t *template_contract) "template_type"); if (! json_is_string (type_val)) - return TALER_MERCHANT_TEMPLATE_TYPE_FIXED_ORDER; + { + GNUNET_break_op (0); + return TALER_MERCHANT_TEMPLATE_TYPE_INVALID; + } return TALER_MERCHANT_template_type_from_string ( json_string_value (type_val)); diff --git a/src/util/token_family_parse.c b/src/util/token_family_parse.c @@ -309,8 +309,10 @@ parse_token_families (void *cls, &family.name), GNUNET_JSON_spec_string_copy ("description", &family.description), - GNUNET_JSON_spec_object_copy ("description_i18n", - &family.description_i18n), + GNUNET_JSON_spec_mark_optional ( + GNUNET_JSON_spec_object_copy ("description_i18n", + &family.description_i18n), + NULL), GNUNET_JSON_spec_array_const ("keys", &keys), spec_token_details ("details", diff --git a/src/util/token_family_serialize.c b/src/util/token_family_serialize.c @@ -133,8 +133,9 @@ TALER_MERCHANT_json_from_token_family ( family->name), GNUNET_JSON_pack_string ("description", family->description), - GNUNET_JSON_pack_object_incref ("description_i18n", - family->description_i18n), + GNUNET_JSON_pack_allow_null ( + GNUNET_JSON_pack_object_incref ("description_i18n", + family->description_i18n)), GNUNET_JSON_pack_array_steal ("keys", keys), GNUNET_JSON_pack_object_steal ("details",