merchant

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

commit fc9d1dcffd6a48fa54ac6baba1d0a2b9acd9f3f3
parent b447fbeb827dc6a0b811d3ce9adc18675fcb7fd3
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue,  4 Aug 2026 14:44:27 +0200

enforce order_id is a slug

Diffstat:
Mdebian/control | 2+-
Msrc/lib/merchant_api_common.c | 4++--
Msrc/lib/merchant_api_post-private-orders.c | 4++--
Msrc/lib/merchant_api_post-templates-TEMPLATE_ID.c | 4++--
Msrc/testing/testing_api_cmd_abort_order.c | 4++--
Msrc/testing/testing_api_cmd_pay_order.c | 4++--
Msrc/testing/testing_api_cmd_wallet_post_orders_refund.c | 4++--
Msrc/util/contract_parse.c | 4++--
Msrc/util/order_parse.c | 4++--
9 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/debian/control b/debian/control @@ -7,7 +7,7 @@ Build-Depends: ninja-build, debhelper-compat (= 12), libgnunet-dev (>=0.28.0~dev5), - libtalerexchange-dev (>=1.5.0), + libtalerexchange-dev (>=1.6.10), libpq-dev (>=15.0), libdonau-dev (>=1.5.0), po-debconf, diff --git a/src/lib/merchant_api_common.c b/src/lib/merchant_api_common.c @@ -456,8 +456,8 @@ TALER_MERCHANT_handle_order_creation_response_ ( bool no_token; bool no_pay_deadline; struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_string ("order_id", - &por.details.ok.order_id), + TALER_JSON_spec_slug ("order_id", + &por.details.ok.order_id), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_fixed_auto ("token", &token), diff --git a/src/lib/merchant_api_post-private-orders.c b/src/lib/merchant_api_post-private-orders.c @@ -170,8 +170,8 @@ handle_post_orders_finished (void *cls, bool no_token; bool no_pay_deadline; struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_string ("order_id", - &por.details.ok.order_id), + TALER_JSON_spec_slug ("order_id", + &por.details.ok.order_id), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_fixed_auto ("token", &token), diff --git a/src/lib/merchant_api_post-templates-TEMPLATE_ID.c b/src/lib/merchant_api_post-templates-TEMPLATE_ID.c @@ -128,8 +128,8 @@ handle_post_templates_finished (void *cls, bool no_token; bool no_pay_deadline; struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_string ("order_id", - &ptr.details.ok.order_id), + TALER_JSON_spec_slug ("order_id", + &ptr.details.ok.order_id), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_fixed_auto ("token", &token), diff --git a/src/testing/testing_api_cmd_abort_order.c b/src/testing/testing_api_cmd_abort_order.c @@ -264,8 +264,8 @@ abort_run (void *cls, /* Get information that needs to be put verbatim in the * deposit permission */ struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_string ("order_id", - &order_id), + TALER_JSON_spec_slug ("order_id", + &order_id), GNUNET_JSON_spec_fixed_auto ("merchant_pub", &merchant_pub), TALER_JSON_spec_amount_any ("amount", diff --git a/src/testing/testing_api_cmd_pay_order.c b/src/testing/testing_api_cmd_pay_order.c @@ -965,8 +965,8 @@ pay_run (void *cls, GNUNET_JSON_spec_uint64 ("version", &version), NULL), - GNUNET_JSON_spec_string ("order_id", - &order_id), + TALER_JSON_spec_slug ("order_id", + &order_id), GNUNET_JSON_spec_timestamp ("refund_deadline", &refund_deadline), GNUNET_JSON_spec_timestamp ("pay_deadline", diff --git a/src/testing/testing_api_cmd_wallet_post_orders_refund.c b/src/testing/testing_api_cmd_wallet_post_orders_refund.c @@ -200,8 +200,8 @@ obtain_refunds_run (void *cls, /* Get information that needs to be put verbatim in the * deposit permission */ struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_string ("order_id", - &order_id), + TALER_JSON_spec_slug ("order_id", + &order_id), GNUNET_JSON_spec_end () }; diff --git a/src/util/contract_parse.c b/src/util/contract_parse.c @@ -158,8 +158,8 @@ TALER_MERCHANT_proto_contract_parse ( { const json_t *products = NULL; struct GNUNET_JSON_Specification espec[] = { - GNUNET_JSON_spec_string_copy ("order_id", - &pc->order_id), + TALER_JSON_spec_slug_copy ("order_id", + &pc->order_id), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_array_const ("products", &products), diff --git a/src/util/order_parse.c b/src/util/order_parse.c @@ -164,8 +164,8 @@ TALER_MERCHANT_order_parse (json_t *input) &products), NULL), GNUNET_JSON_spec_mark_optional ( - GNUNET_JSON_spec_string_copy ("order_id", - &order->order_id), + TALER_JSON_spec_slug_copy ("order_id", + &order->order_id), NULL), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_timestamp ("timestamp",