exchange

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

get_wire_accounts.h (4023B)


      1 /*
      2    This file is part of TALER
      3    Copyright (C) 2022 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/get_wire_accounts.h
     18  * @brief implementation of the get_wire_accounts function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_GET_WIRE_ACCOUNTS_H
     22 #define EXCHANGE_DATABASE_GET_WIRE_ACCOUNTS_H
     23 
     24 #include "taler/taler_util.h"
     25 #include "taler/taler_json_lib.h"
     26 #include "exchangedb_lib.h"
     27 
     28 
     29 /**
     30  * Provide information about a wire account.
     31  *
     32  * @param cls closure
     33  * @param payto_uri the exchange bank account URI
     34  * @param conversion_url URL of a conversion service, NULL if there is no conversion
     35  * @param open_banking_gateway open banking gateway service, NULL if unavailable
     36  * @param wire_transfer_gateway wire transfer gateway service, NULL if unavailable
     37  * @param debit_restrictions JSON array with debit restrictions on the account
     38  * @param credit_restrictions JSON array with credit restrictions on the account
     39  * @param master_sig master key signature affirming that this is a bank
     40  *                   account of the exchange (of purpose #TALER_SIGNATURE_MASTER_WIRE_DETAILS)
     41  * @param bank_label label the wallet should use to display the account, can be NULL
     42  * @param priority priority for ordering bank account labels
     43  */
     44 typedef void
     45 (*TALER_EXCHANGEDB_WireAccountCallback)(
     46   void *cls,
     47   const struct TALER_FullPayto payto_uri,
     48   const char *conversion_url,
     49   const char *open_banking_gateway,
     50   const char *wire_transfer_gateway,
     51   const json_t *debit_restrictions,
     52   const json_t *credit_restrictions,
     53   const struct TALER_MasterSignatureP *master_sig,
     54   const char *bank_label,
     55   int64_t priority);
     56 
     57 
     58 /* Callback typedefs */
     59 /**
     60  * Provide information about a wire account.
     61  *
     62  * @param cls closure
     63  * @param payto_uri the exchange bank account URI
     64  * @param conversion_url URL of a conversion service, NULL if there is no conversion
     65  * @param open_banking_gateway open banking gateway service, NULL if unavailable
     66  * @param wire_transfer_gateway wire transfer gateway service, NULL if unavailable
     67  * @param debit_restrictions JSON array with debit restrictions on the account
     68  * @param credit_restrictions JSON array with credit restrictions on the account
     69  * @param master_sig master key signature affirming that this is a bank
     70  *                   account of the exchange (of purpose #TALER_SIGNATURE_MASTER_WIRE_DETAILS)
     71  * @param bank_label label the wallet should use to display the account, can be NULL
     72  * @param priority priority for ordering bank account labels
     73  */
     74 typedef void
     75 (*TALER_EXCHANGEDB_WireAccountCallback)(
     76   void *cls,
     77   const struct TALER_FullPayto payto_uri,
     78   const char *conversion_url,
     79   const char *open_banking_gateway,
     80   const char *wire_transfer_gateway,
     81   const json_t *debit_restrictions,
     82   const json_t *credit_restrictions,
     83   const struct TALER_MasterSignatureP *master_sig,
     84   const char *bank_label,
     85   int64_t priority);
     86 
     87 /**
     88  * Obtain information about the enabled wire accounts of the exchange.
     89  *
     90  * @param pg the database context
     91  * @param cb function to call on each account
     92  * @param cb_cls closure for @a cb
     93  * @return transaction status code
     94  */
     95 enum GNUNET_DB_QueryStatus
     96 TALER_EXCHANGEDB_get_wire_accounts (struct TALER_EXCHANGEDB_PostgresContext *pg,
     97                                     TALER_EXCHANGEDB_WireAccountCallback cb,
     98                                     void *cb_cls);
     99 
    100 #endif