aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/pg_update_wire.c
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-05-12 13:40:22 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2023-05-12 13:40:22 +0200
commit4833234df63d7da774299b336adb925e700bd4b4 (patch)
treeabb478b860c2d3f292ded9364300ce73b1d60d11 /src/exchangedb/pg_update_wire.c
parent9130cda9e775131d3ced613b7f238a4c9e43ad5a (diff)
parentff1a28319fe31741958a0b1cfa761fd44878db45 (diff)
downloadexchange-4833234df63d7da774299b336adb925e700bd4b4.tar.xz
Merge branch 'master' into age-withdraw
Diffstat (limited to 'src/exchangedb/pg_update_wire.c')
-rw-r--r--src/exchangedb/pg_update_wire.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/exchangedb/pg_update_wire.c b/src/exchangedb/pg_update_wire.c
index 4059348c9..0c4ec7b58 100644
--- a/src/exchangedb/pg_update_wire.c
+++ b/src/exchangedb/pg_update_wire.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2022 Taler Systems SA
+ Copyright (C) 2022, 2023 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
@@ -29,6 +29,9 @@
enum GNUNET_DB_QueryStatus
TEH_PG_update_wire (void *cls,
const char *payto_uri,
+ const char *conversion_url,
+ json_t *debit_restrictions,
+ json_t *credit_restrictions,
struct GNUNET_TIME_Timestamp change_date,
bool enabled)
{
@@ -36,17 +39,28 @@ TEH_PG_update_wire (void *cls,
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_string (payto_uri),
GNUNET_PQ_query_param_bool (enabled),
+ NULL == conversion_url
+ ? GNUNET_PQ_query_param_null ()
+ : GNUNET_PQ_query_param_string (conversion_url),
+ enabled
+ ? TALER_PQ_query_param_json (debit_restrictions)
+ : GNUNET_PQ_query_param_null (),
+ enabled
+ ? TALER_PQ_query_param_json (credit_restrictions)
+ : GNUNET_PQ_query_param_null (),
GNUNET_PQ_query_param_timestamp (&change_date),
GNUNET_PQ_query_param_end
};
- /* used in #postgres_update_wire() */
PREPARE (pg,
"update_wire",
"UPDATE wire_accounts"
" SET"
" is_active=$2"
- " ,last_change=$3"
+ " ,conversion_url=$3"
+ " ,debit_restrictions=$4"
+ " ,credit_restrictions=$5"
+ " ,last_change=$6"
" WHERE payto_uri=$1");
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
"update_wire",