merchant

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

commit f0743cdbd4f012a3b55fa1fee8e49ab359f48e15
parent b557d5c8fc5550e9ec854fdd224977dc68ffa40a
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 22 Feb 2026 12:41:16 +0100

prepare for passing extra wire subject metadata to exchange

Diffstat:
Msrc/backend/taler-merchant-httpd.c | 5+++++
Msrc/backend/taler-merchant-httpd.h | 5+++++
Msrc/backend/taler-merchant-httpd_post-orders-ID-pay.c | 3++-
Msrc/backenddb/pg_select_accounts.c | 9++++++++-
4 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c @@ -145,11 +145,13 @@ static int global_ret; */ const struct GNUNET_CONFIGURATION_Handle *TMH_cfg; + void TMH_wire_method_free (struct TMH_WireMethod *wm) { GNUNET_free (wm->payto_uri.full_payto); GNUNET_free (wm->wire_method); + GNUNET_free (wm->extra_wire_subject_metadata); GNUNET_free (wm->credit_facade_url); json_decref (wm->credit_facade_credentials); GNUNET_free (wm); @@ -784,6 +786,9 @@ add_account_cb (void *cls, wm->h_wire = acc->h_wire; wm->payto_uri.full_payto = GNUNET_strdup (acc->payto_uri.full_payto); + if (NULL != acc->extra_wire_subject_metadata) + wm->extra_wire_subject_metadata + = GNUNET_strdup (acc->extra_wire_subject_metadata); wm->wire_salt = acc->salt; wm->wire_method = TALER_payto_get_method (acc->payto_uri.full_payto); diff --git a/src/backend/taler-merchant-httpd.h b/src/backend/taler-merchant-httpd.h @@ -149,6 +149,11 @@ struct TMH_WireMethod json_t *credit_facade_credentials; /** + * Additional metadata to pass in the wire subject. NULL for none. + */ + char *extra_wire_subject_metadata; + + /** * Is this wire method active (should it be included in new contracts)? */ bool active; diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2014-2025 Taler Systems SA + (C) 2014-2026 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -1612,6 +1612,7 @@ AGE_FAIL: struct TALER_EXCHANGE_DepositContractDetail dcd = { .wire_deadline = pc->check_contract.contract_terms->wire_deadline, .merchant_payto_uri = pc->check_contract.wm->payto_uri, + // FIXME-11119: .extra_wire_subject_metadata = pc->check_contract.wm->extra_wire_subject_metadata, .wire_salt = pc->check_contract.wm->wire_salt, .h_contract_terms = pc->check_contract.h_contract_terms, .wallet_data_hash = pc->parse_wallet_data.h_wallet_data, diff --git a/src/backenddb/pg_select_accounts.c b/src/backenddb/pg_select_accounts.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2022 Taler Systems SA + Copyright (C) 2022, 2026 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -74,6 +74,7 @@ select_account_cb (void *cls, struct TALER_FullPayto payto; char *instance_id; char *facade_url = NULL; + char *extra_wire_subject_metadata = NULL; json_t *credential = NULL; struct TALER_MERCHANTDB_AccountDetails acc; struct TALER_MerchantPrivateKeyP merchant_priv; @@ -92,6 +93,10 @@ select_account_cb (void *cls, &facade_url), NULL), GNUNET_PQ_result_spec_allow_null ( + GNUNET_PQ_result_spec_string ("extra_wire_subject_metadata", + &extra_wire_subject_metadata), + NULL), + GNUNET_PQ_result_spec_allow_null ( TALER_PQ_result_spec_json ("credit_facade_credentials", &credential), NULL), @@ -117,6 +122,7 @@ select_account_cb (void *cls, acc.payto_uri = payto; acc.credit_facade_url = facade_url; acc.credit_facade_credentials = credential; + acc.extra_wire_subject_metadata = extra_wire_subject_metadata; if (NULL != lic->cb) lic->cb (lic->cb_cls, no_priv ? NULL : &merchant_priv, @@ -155,6 +161,7 @@ TMH_PG_select_accounts (void *cls, ",ma.payto_uri" ",ma.credit_facade_url" ",ma.credit_facade_credentials::TEXT" + ",ma.extra_wire_subject_metadata" ",ma.active" ",mk.merchant_priv" ",mi.merchant_id"