aboutsummaryrefslogtreecommitdiff
path: root/src/backenddb/pg_account_kyc_set_status.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-09-08 09:52:53 +0200
committerChristian Grothoff <christian@grothoff.org>2024-09-08 09:52:53 +0200
commit985e44ce78eaaf3f2076f87ca7f6481af5608b2e (patch)
tree89b4c265264895a9a4dda8c8558371e7fb873f68 /src/backenddb/pg_account_kyc_set_status.c
parent409fc3fea7a33e4efe66321c79b6531d44bd6571 (diff)
add logic to notify other services about KYC status changes
Diffstat (limited to 'src/backenddb/pg_account_kyc_set_status.c')
-rw-r--r--src/backenddb/pg_account_kyc_set_status.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/backenddb/pg_account_kyc_set_status.c b/src/backenddb/pg_account_kyc_set_status.c
index c4e8bd97..ecd63fb3 100644
--- a/src/backenddb/pg_account_kyc_set_status.c
+++ b/src/backenddb/pg_account_kyc_set_status.c
@@ -42,6 +42,13 @@ TMH_PG_account_kyc_set_status (
bool kyc_ok)
{
struct PostgresClosure *pg = cls;
+ struct TALER_MERCHANTDB_MerchantKycStatusChangeEventP ev = {
+ .header.size = htons (sizeof (ev)),
+ .header.type = htons (TALER_DBEVENT_MERCHANT_EXCHANGE_KYC_STATUS_CHANGED),
+ .h_wire = *h_wire
+ };
+ char *notify_s
+ = GNUNET_PQ_get_event_notify_channel (&ev.header);
uint32_t http_status32 = (uint32_t) exchange_http_status;
uint32_t ec_code32 = (uint32_t) exchange_ec_code;
struct GNUNET_PQ_QueryParam params[] = {
@@ -59,6 +66,7 @@ TMH_PG_account_kyc_set_status (
: GNUNET_PQ_query_param_null (),
GNUNET_PQ_query_param_bool (in_aml_review),
GNUNET_PQ_query_param_bool (kyc_ok),
+ GNUNET_PQ_query_param_string (notify_s),
GNUNET_PQ_query_param_end
};
bool no_instance;
@@ -79,12 +87,13 @@ TMH_PG_account_kyc_set_status (
" out_no_instance AS no_instance"
" ,out_no_account AS no_account"
" FROM merchant_do_account_kyc_set_status"
- "($1, $2, $3, $4, $5, $6, $7, $8, $9, $10);");
+ "($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11);");
qs = GNUNET_PQ_eval_prepared_singleton_select (
pg->conn,
"account_kyc_set_status",
params,
rs);
+ GNUNET_free (notify_s);
if (qs <= 0)
{
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR != qs);