summaryrefslogtreecommitdiff
path: root/src/exchangedb/irbt_callbacks.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-03-05 14:36:49 +0100
committerChristian Grothoff <christian@grothoff.org>2022-03-05 14:36:55 +0100
commit7ff58c3d8f2351c57142b4b65ab75304f355fc4f (patch)
tree4d5de28cbc2cb51b9946c924b7dd228cfe0d0634 /src/exchangedb/irbt_callbacks.c
parent8a906bf96c9c418dbd58727284eb5cfdd6fdff24 (diff)
downloadexchange-7ff58c3d8f2351c57142b4b65ab75304f355fc4f.tar.gz
exchange-7ff58c3d8f2351c57142b4b65ab75304f355fc4f.tar.bz2
exchange-7ff58c3d8f2351c57142b4b65ab75304f355fc4f.zip
refactor /wire to include logic to return the wad fee (for W2W payments)
Diffstat (limited to 'src/exchangedb/irbt_callbacks.c')
-rw-r--r--src/exchangedb/irbt_callbacks.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/exchangedb/irbt_callbacks.c b/src/exchangedb/irbt_callbacks.c
index deab3cfca..ae4863436 100644
--- a/src/exchangedb/irbt_callbacks.c
+++ b/src/exchangedb/irbt_callbacks.c
@@ -635,8 +635,9 @@ irbt_cb_table_wire_fee (struct PostgresClosure *pg,
GNUNET_PQ_query_param_string (td->details.wire_fee.wire_method),
GNUNET_PQ_query_param_timestamp (&td->details.wire_fee.start_date),
GNUNET_PQ_query_param_timestamp (&td->details.wire_fee.end_date),
- TALER_PQ_query_param_amount (&td->details.wire_fee.wire_fee),
- TALER_PQ_query_param_amount (&td->details.wire_fee.closing_fee),
+ TALER_PQ_query_param_amount (&td->details.wire_fee.fees.wire),
+ TALER_PQ_query_param_amount (&td->details.wire_fee.fees.closing),
+ TALER_PQ_query_param_amount (&td->details.wire_fee.fees.wad),
GNUNET_PQ_query_param_auto_from_type (&td->details.wire_fee.master_sig),
GNUNET_PQ_query_param_end
};
@@ -648,6 +649,32 @@ irbt_cb_table_wire_fee (struct PostgresClosure *pg,
/**
+ * Function called with wire_fee records to insert into table.
+ *
+ * @param pg plugin context
+ * @param td record to insert
+ */
+static enum GNUNET_DB_QueryStatus
+irbt_cb_table_global_fee (struct PostgresClosure *pg,
+ const struct TALER_EXCHANGEDB_TableData *td)
+{
+ struct GNUNET_PQ_QueryParam params[] = {
+ GNUNET_PQ_query_param_uint64 (&td->serial),
+ GNUNET_PQ_query_param_timestamp (&td->details.global_fee.start_date),
+ GNUNET_PQ_query_param_timestamp (&td->details.global_fee.end_date),
+ TALER_PQ_query_param_amount (&td->details.global_fee.fees.history),
+ TALER_PQ_query_param_amount (&td->details.global_fee.fees.kyc),
+ GNUNET_PQ_query_param_auto_from_type (&td->details.wire_fee.master_sig),
+ GNUNET_PQ_query_param_end
+ };
+
+ return GNUNET_PQ_eval_prepared_non_select (pg->conn,
+ "insert_into_table_global_fee",
+ params);
+}
+
+
+/**
* Function called with recoup records to insert into table.
*
* @param pg plugin context