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 (4363B)


      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 prepared_transfer_url prepared transfer 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 #ifndef TALER_EXCHANGEDB_WIRE_ACCOUNT_RESULT_CLOSURE
     45 /**
     46  * Type of the closure for #TALER_EXCHANGEDB_WireAccountCallback.
     47  */
     48 #define TALER_EXCHANGEDB_WIRE_ACCOUNT_RESULT_CLOSURE void
     49 #endif
     50 typedef void
     51 (*TALER_EXCHANGEDB_WireAccountCallback)(
     52   TALER_EXCHANGEDB_WIRE_ACCOUNT_RESULT_CLOSURE *cls,
     53   const struct TALER_FullPayto payto_uri,
     54   const char *conversion_url,
     55   const char *open_banking_gateway,
     56   const char *prepared_transfer_url,
     57   const json_t *debit_restrictions,
     58   const json_t *credit_restrictions,
     59   const struct TALER_MasterSignatureP *master_sig,
     60   const char *bank_label,
     61   int64_t priority);
     62 
     63 
     64 /* Callback typedefs */
     65 /**
     66  * Provide information about a wire account.
     67  *
     68  * @param cls closure
     69  * @param payto_uri the exchange bank account URI
     70  * @param conversion_url URL of a conversion service, NULL if there is no conversion
     71  * @param open_banking_gateway open banking gateway service, NULL if unavailable
     72  * @param prepared_transfer_url prepared transfer service, NULL if unavailable
     73  * @param debit_restrictions JSON array with debit restrictions on the account
     74  * @param credit_restrictions JSON array with credit restrictions on the account
     75  * @param master_sig master key signature affirming that this is a bank
     76  *                   account of the exchange (of purpose #TALER_SIGNATURE_MASTER_WIRE_DETAILS)
     77  * @param bank_label label the wallet should use to display the account, can be NULL
     78  * @param priority priority for ordering bank account labels
     79  */
     80 typedef void
     81 (*TALER_EXCHANGEDB_WireAccountCallback)(
     82   TALER_EXCHANGEDB_WIRE_ACCOUNT_RESULT_CLOSURE *cls,
     83   const struct TALER_FullPayto payto_uri,
     84   const char *conversion_url,
     85   const char *open_banking_gateway,
     86   const char *prepared_transfer_url,
     87   const json_t *debit_restrictions,
     88   const json_t *credit_restrictions,
     89   const struct TALER_MasterSignatureP *master_sig,
     90   const char *bank_label,
     91   int64_t priority);
     92 
     93 /**
     94  * Obtain information about the enabled wire accounts of the exchange.
     95  *
     96  * @param pg the database context
     97  * @param cb function to call on each account
     98  * @param cb_cls closure for @a cb
     99  * @return transaction status code
    100  */
    101 enum GNUNET_DB_QueryStatus
    102 TALER_EXCHANGEDB_get_wire_accounts (struct TALER_EXCHANGEDB_PostgresContext *pg,
    103                                     TALER_EXCHANGEDB_WireAccountCallback cb,
    104                                     TALER_EXCHANGEDB_WIRE_ACCOUNT_RESULT_CLOSURE
    105                                     *cb_cls);
    106 
    107 #endif