merchant

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

commit bfc2668f58bef4735320bbc21219f8357674f8ab
parent c4c816513b1d39bb542c8e1b4d9811a0d4725213
Author: Florian Dold <florian@dold.me>
Date:   Wed, 22 Jul 2026 12:32:21 +0200

include KYC: prefix in /kycauth SIMPLE response

Diffstat:
Msrc/backend/taler-merchant-httpd_post-private-accounts-H_WIRE-kycauth.c | 21++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_post-private-accounts-H_WIRE-kycauth.c b/src/backend/taler-merchant-httpd_post-private-accounts-H_WIRE-kycauth.c @@ -289,21 +289,32 @@ kac_cleanup (void *cls) * @return freshly allocated JSON object, or NULL on error */ static json_t * -transfer_subject_to_json (const struct ExchangeAccount *acc, +kyc_transfer_subject_to_json (const struct ExchangeAccount *acc, const struct TALER_BANK_TransferSubject *ts) { struct KycAuthContext *kac = acc->kac; + json_t *ret; switch (ts->format) { case TALER_BANK_SUBJECT_FORMAT_SIMPLE: - return GNUNET_JSON_PACK ( + struct GNUNET_Buffer buf = { 0 }; + char *subject; + GNUNET_buffer_write_str (&buf, + "KYC:"); + GNUNET_buffer_write_data_encoded (&buf, + &kac->hc->instance->merchant_pub, + sizeof (kac->hc->instance->merchant_pub)); + subject = GNUNET_buffer_reap_str (&buf); + ret = GNUNET_JSON_PACK ( GNUNET_JSON_pack_string ("type", "SIMPLE"), TALER_JSON_pack_amount ("credit_amount", &kac->tiny_amount), - GNUNET_JSON_pack_data_auto ("subject", - &kac->hc->instance->merchant_pub)); + GNUNET_JSON_pack_string ("subject", + subject)); + GNUNET_free (subject); + return ret; case TALER_BANK_SUBJECT_FORMAT_URI: return GNUNET_JSON_PACK ( GNUNET_JSON_pack_string ("type", @@ -348,7 +359,7 @@ generate_ok_response (struct KycAuthContext *kac) for (unsigned int j = 0; j < acc->num_subjects; j++) { - subj = transfer_subject_to_json (acc, + subj = kyc_transfer_subject_to_json (acc, &acc->subjects[j]); GNUNET_assert (NULL != subj); entry = GNUNET_JSON_PACK (