exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

insert_kycauth_in_inconsistency.c (2236B)


      1 /*
      2    This file is part of TALER
      3    Copyright (C) 2026 Taler Systems SA
      4 
      5    TALER is free software; you can redistribute it and/or modify it under the
      6    terms of the GNU General Public License as published by the Free Software
      7    Foundation; either version 3, or (at your option) any later version.
      8 
      9    TALER is distributed in the hope that it will be useful, but WITHOUT ANY
     10    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11    A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     12 
     13    You should have received a copy of the GNU General Public License along with
     14    TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15  */
     16 /**
     17  * @file src/auditordb/insert_kycauth_in_inconsistency.c
     18  * @brief Implementation of the insert_kycauth_in_inconsistency function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #include "taler/taler_pq_lib.h"
     22 #include "pg_helper.h"
     23 #include "auditor-database/insert_kycauth_in_inconsistency.h"
     24 
     25 
     26 enum GNUNET_DB_QueryStatus
     27 TALER_AUDITORDB_insert_kycauth_in_inconsistency (
     28   struct TALER_AUDITORDB_PostgresContext *pg,
     29   const struct TALER_AUDITORDB_KycauthInInconsistency *dc)
     30 {
     31   struct GNUNET_PQ_QueryParam params[] = {
     32     GNUNET_PQ_query_param_uint64 (&dc->bank_row_id),
     33     TALER_PQ_query_param_amount (pg->conn,
     34                                  &dc->amount_exchange_expected),
     35     TALER_PQ_query_param_amount (pg->conn,
     36                                  &dc->amount_wired),
     37     GNUNET_PQ_query_param_auto_from_type (&dc->account_pub),
     38     GNUNET_PQ_query_param_absolute_time (&dc->timestamp),
     39     GNUNET_PQ_query_param_string (dc->account.full_payto),
     40     GNUNET_PQ_query_param_string (dc->diagnostic),
     41     GNUNET_PQ_query_param_end
     42   };
     43 
     44   PREPARE (pg,
     45            "insert_kycauth_in_inconsistency",
     46            "INSERT INTO auditor_kycauth_in_inconsistency "
     47            "(bank_row_id,"
     48            " amount_exchange_expected,"
     49            " amount_wired,"
     50            " account_pub,"
     51            " timestamp,"
     52            " account,"
     53            " diagnostic"
     54            ") VALUES ($1,$2,$3,$4,$5,$6,$7);"
     55            );
     56   return GNUNET_PQ_eval_prepared_non_select (
     57     pg->conn,
     58     "insert_kycauth_in_inconsistency",
     59     params);
     60 }