exchange

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

do_reserve_legitimization_process.h (2670B)


      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/include/exchange-database/do_reserve_legitimization_process.h
     18  * @brief atomically reserve or reuse an external KYC process
     19  */
     20 #ifndef EXCHANGE_DATABASE_DO_RESERVE_LEGITIMIZATION_PROCESS_H
     21 #define EXCHANGE_DATABASE_DO_RESERVE_LEGITIMIZATION_PROCESS_H
     22 
     23 #include "taler/taler_util.h"
     24 #include "exchangedb_lib.h"
     25 
     26 enum TALER_EXCHANGEDB_KycProcessReservationState
     27 {
     28   /** A reusable redirect URL is available. */
     29   TALER_EXCHANGEDB_KPRS_READY = 0,
     30 
     31   /** The caller owns the reservation and must initiate the provider. */
     32   TALER_EXCHANGEDB_KPRS_OWNER = 1,
     33 
     34   /** Another caller is currently initiating the provider. */
     35   TALER_EXCHANGEDB_KPRS_BUSY = 2
     36 };
     37 
     38 
     39 /**
     40  * Atomically reuse, wait for, or reserve an external KYC process.
     41  *
     42  * Primary test table: `legitimization_processes` (see
     43  * test_legitimization_processes.c).
     44  *
     45  * @param pg database context
     46  * @param h_payto account to validate
     47  * @param measure_index selected measure index
     48  * @param legitimization_measure_serial_id selected measure row
     49  * @param provider_name provider configuration name
     50  * @param now current time
     51  * @param lease_expiration expiration of a newly reserved initiation lease
     52  * @param[out] process_row process row that was selected or reserved
     53  * @param[out] start_time generation of @a process_row
     54  * @param[out] redirect_url reusable redirect for READY, otherwise NULL
     55  * @param[out] state result of the reservation attempt
     56  * @return database query status
     57  */
     58 enum GNUNET_DB_QueryStatus
     59 TALER_EXCHANGEDB_do_reserve_legitimization_process (
     60   struct TALER_EXCHANGEDB_PostgresContext *pg,
     61   const struct TALER_NormalizedPaytoHashP *h_payto,
     62   uint32_t measure_index,
     63   uint64_t legitimization_measure_serial_id,
     64   const char *provider_name,
     65   struct GNUNET_TIME_Absolute now,
     66   struct GNUNET_TIME_Absolute lease_expiration,
     67   uint64_t *process_row,
     68   struct GNUNET_TIME_Absolute *start_time,
     69   char **redirect_url,
     70   enum TALER_EXCHANGEDB_KycProcessReservationState *state);
     71 
     72 #endif