merchant

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

commit fe8d74937835ffa0c29ea13838b78839008578ba
parent e578f078d79a75159c5de5a418547a9210568a79
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Fri, 23 Jan 2026 09:52:20 +0900

add new 'unsupported-account' KYC state to make it clear if an exchange does not support a bank account (#10907-related)

Diffstat:
Msrc/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c | 3+++
Msrc/backend/taler-merchant-kyccheck.c | 41+++++++++++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c b/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c @@ -581,6 +581,9 @@ map_to_status (const struct ExchangeKycRequest *ekr) switch (ekr->last_http_status) { case 0: + if (TALER_EC_MERCHANT_PRIVATE_ACCOUNT_NOT_ELIGIBLE_FOR_EXCHANGE == ekr-> + last_ec) + return "unsupported-account"; return "exchange-unreachable"; case MHD_HTTP_OK: /* then we should have kyc_ok */ diff --git a/src/backend/taler-merchant-kyccheck.c b/src/backend/taler-merchant-kyccheck.c @@ -342,6 +342,12 @@ static struct GNUNET_DB_EventHandler *eh_keys; static struct GNUNET_DB_EventHandler *eh_rule; /** + * Event handler to learn that we got new /keys + * from an exchange and should reconsider eligibility. + */ +static struct GNUNET_DB_EventHandler *keys_rule; + +/** * Main task to discover (new) accounts. */ static struct GNUNET_SCHEDULER_Task *account_task; @@ -948,13 +954,43 @@ start_inquiries (struct Account *a) { if (is_eligible (e->keys, a)) + { start_inquiry (e, a); + } else + { + enum GNUNET_DB_QueryStatus qs; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Account %s not eligible at exchange %s\n", a->merchant_account_uri.full_payto, e->keys->exchange_url); + qs = db_plugin->account_kyc_set_status ( + db_plugin->cls, + a->instance_id, + &a->h_wire, + e->keys->exchange_url, + GNUNET_TIME_timestamp_get (), + 0, + TALER_EC_MERCHANT_PRIVATE_ACCOUNT_NOT_ELIGIBLE_FOR_EXCHANGE, + 0, + NULL, + NULL, + false, + false); + if (qs < 0) + { + GNUNET_break (0); + global_ret = EXIT_FAILURE; + GNUNET_SCHEDULER_shutdown (); + return; + } + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "account_set_kyc_status (%s) returned %d\n", + e->keys->exchange_url, + (int) qs); + } } } @@ -1409,6 +1445,11 @@ shutdown_task (void *cls) db_plugin->event_listen_cancel (eh_rule); eh_rule = NULL; } + if (NULL != keys_rule) + { + db_plugin->event_listen_cancel (keys_rule); + keys_rule = NULL; + } TALER_MERCHANTDB_plugin_unload (db_plugin); db_plugin = NULL; cfg = NULL;