[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 88/124: implement wad_in_insert
From: |
gnunet |
Subject: |
[taler-exchange] 88/124: implement wad_in_insert |
Date: |
Tue, 17 Sep 2024 21:28:20 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to tag cg-aml-branch-compiles
in repository exchange.
commit 6710119db120d63a2f31602c462f0ab0c4599a23
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Jul 16 21:37:14 2024 +0200
implement wad_in_insert
---
src/exchange/taler-exchange-wirewatch.c | 1 +
src/exchangedb/pg_wad_in_insert.c | 26 ++++++++++++++++++++++++--
src/exchangedb/pg_wad_in_insert.h | 2 ++
src/include/taler_exchangedb_plugin.h | 2 ++
4 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/src/exchange/taler-exchange-wirewatch.c
b/src/exchange/taler-exchange-wirewatch.c
index 12aebbcae..7db82f7b6 100644
--- a/src/exchange/taler-exchange-wirewatch.c
+++ b/src/exchange/taler-exchange-wirewatch.c
@@ -619,6 +619,7 @@ process_reply (const struct TALER_BANK_CreditDetails
*details,
db_plugin->cls,
&cd->details.wad.wad_id,
cd->details.wad.origin_exchange_url,
+ &cd->amount,
cd->execution_date,
cd->debit_account_uri,
ai->section_name,
diff --git a/src/exchangedb/pg_wad_in_insert.c
b/src/exchangedb/pg_wad_in_insert.c
index 387273d35..95d792b14 100644
--- a/src/exchangedb/pg_wad_in_insert.c
+++ b/src/exchangedb/pg_wad_in_insert.c
@@ -30,11 +30,33 @@ TEH_PG_wad_in_insert (
void *cls,
const struct TALER_WadIdentifierP *wad_id,
const char *origin_exchange_url,
+ const struct TALER_Amount *amount,
struct GNUNET_TIME_Timestamp execution_date,
const char *debit_account_uri,
const char *section_name,
uint64_t serial_id)
{
- // FIXME: not implemented
- return -1;
+ struct PostgresClosure *pg = cls;
+ struct GNUNET_PQ_QueryParam params[] = {
+ GNUNET_PQ_query_param_auto_from_type (wad_id),
+ GNUNET_PQ_query_param_string (origin_exchange_url),
+ TALER_PQ_query_param_amount (pg->conn,
+ amount),
+ GNUNET_PQ_query_param_timestamp (&execution_date),
+ GNUNET_PQ_query_param_end
+ };
+
+ // FIXME: should we keep the account data + serial_id?
+ PREPARE (pg,
+ "wad_in_insert",
+ "INSERT INTO wads_in "
+ "(wad_id"
+ ",origin_exchange_url"
+ ",amount"
+ ",arrival_time"
+ ") VALUES "
+ "($1, $2, $3, $4);");
+ return GNUNET_PQ_eval_prepared_non_select (pg->conn,
+ "wad_in_insert",
+ params);
}
diff --git a/src/exchangedb/pg_wad_in_insert.h
b/src/exchangedb/pg_wad_in_insert.h
index 0498412c0..d6c2b25c4 100644
--- a/src/exchangedb/pg_wad_in_insert.h
+++ b/src/exchangedb/pg_wad_in_insert.h
@@ -32,6 +32,7 @@
* @param cls the @e cls of this struct with the plugin-specific state
* @param wad_id WAD identifier
* @param origin_exchange_url exchange base URL originating the transfer
+ * @param amount the amount that was transferred
* @param execution_date when was the transfer made
* @param debit_account_uri URI of the debit account
* @param section_name section of the exchange bank account that received the
transfer
@@ -42,6 +43,7 @@ TEH_PG_wad_in_insert (
void *cls,
const struct TALER_WadIdentifierP *wad_id,
const char *origin_exchange_url,
+ const struct TALER_Amount *amount,
struct GNUNET_TIME_Timestamp execution_date,
const char *debit_account_uri,
const char *section_name,
diff --git a/src/include/taler_exchangedb_plugin.h
b/src/include/taler_exchangedb_plugin.h
index 0594461d0..7645eb03e 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -3918,6 +3918,7 @@ struct TALER_EXCHANGEDB_Plugin
* @param cls the @e cls of this struct with the plugin-specific state
* @param wad_id WAD identifier
* @param origin_exchange_url exchange base URL originating the transfer
+ * @param amount the amount that was transferred
* @param execution_date when was the transfer made
* @param debit_account_uri URI of the debit account
* @param section_name section of the exchange bank account that received
the transfer
@@ -3928,6 +3929,7 @@ struct TALER_EXCHANGEDB_Plugin
void *cls,
const struct TALER_WadIdentifierP *wad_id,
const char *origin_exchange_url,
+ const struct TALER_Amount *amount,
struct GNUNET_TIME_Timestamp execution_date,
const char *debit_account_uri,
const char *section_name,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-exchange] 70/124: more work on KYC upload, (continued)
- [taler-exchange] 70/124: more work on KYC upload, gnunet, 2024/09/17
- [taler-exchange] 42/124: implement more basic KYCLOGIC functions, gnunet, 2024/09/17
- [taler-exchange] 79/124: -bump gana, gnunet, 2024/09/17
- [taler-exchange] 54/124: move ID computation into libtalerutil, gnunet, 2024/09/17
- [taler-exchange] 123/124: -fix age withdraw test, gnunet, 2024/09/17
- [taler-exchange] 84/124: add account_sig for authorization, gnunet, 2024/09/17
- [taler-exchange] 112/124: more bugfixes, gnunet, 2024/09/17
- [taler-exchange] 48/124: add spa logic, gnunet, 2024/09/17
- [taler-exchange] 97/124: fix leak, expand logging, gnunet, 2024/09/17
- [taler-exchange] 96/124: -SQL fixes, gnunet, 2024/09/17
- [taler-exchange] 88/124: implement wad_in_insert,
gnunet <=
- [taler-exchange] 104/124: new test command for KYC wire transfers, gnunet, 2024/09/17
- [taler-exchange] 90/124: pass h_payto, gnunet, 2024/09/17
- [taler-exchange] 93/124: return KYCAUTH transfers from fakebank account history API, gnunet, 2024/09/17
- [taler-exchange] 117/124: WiP, gnunet, 2024/09/17
- [taler-exchange] 115/124: -fix SQL, gnunet, 2024/09/17
- [taler-exchange] 120/124: -misc bugfixes, gnunet, 2024/09/17
- [taler-exchange] 64/124: get AML measures skeleton", gnunet, 2024/09/17
- [taler-exchange] 69/124: -towards form uploads (incomplete), gnunet, 2024/09/17
- [taler-exchange] 124/124: fix test_kyc_api FTBFS, gnunet, 2024/09/17
- [taler-exchange] 92/124: implement new admin kycauth incoming endpoint in fakebank, gnunet, 2024/09/17