cash2ecash

cash2ecash: cash acceptor that issues digital cash (experimental)
Log | Files | Refs | README | LICENSE

bank_api_get_config.h (4150B)


      1 #ifndef BANK_API_GET_CONFIG_H
      2 #define BANK_API_GET_CONFIG_H
      3 
      4 #include "../taler/taler_digitizer_service.h"
      5 
      6 
      7 /**
      8  * @brief Information we get from the bank about itself. and is needed for the digitizer
      9  */
     10 struct TALER_BANK_ConfigInformation
     11 {
     12 
     13   /**
     14    * Supported Taler protocol version by the bank.
     15    * String in the format current:revision:age using the
     16    * semantics of GNU libtool.  See
     17    * https://www.gnu.org/software/libtool/manual/html_node/Versioning.html#Versioning
     18    */
     19   const char *version;
     20 
     21   /**
     22    * Currency used by this bank.
     23    */
     24   const char *currency;
     25 
     26   /**
     27    * Minimum wire transfer amount allowed. Only applies to bank transactions and withdrawals.
     28    */
     29   struct TALER_Amount min_wire_transfer_amount;
     30 
     31   /**
     32    * Maximum wire transfer amount allowed. Only applies to bank transactions and withdrawals.
     33   */
     34   struct TALER_Amount max_wire_transfer_amount;
     35 
     36   /**
     37    * How the bank SPA should render this currency.
     38    */
     39   struct TALER_CurrencySpecification currency_specification;
     40 
     41     /**
     42    * Bank display name to be used in user interfaces.
     43    * For consistency use "Taler Bank" if missing.
     44    */
     45   const char *bank_name;
     46 
     47   /**
     48    * Wire transfer execution fees. Only applies to bank transactions and withdrawals.
     49    */
     50   struct TALER_Amount wire_transfer_fees;
     51 
     52   // /**
     53   //  * Name of api
     54   //  */
     55   // const char *api_name;
     56 
     57 
     58   // /**
     59   //  * Advertised base URL to use when you sharing an URL with another program.
     60   //  */
     61   // const char *base_url;
     62 
     63   // /** If 'true' the server provides local currency conversion support
     64   //  * If 'false' some parts of the API are not supported and return 501
     65   //  */
     66   // const bool allow_conversion;
     67 
     68   // /** If 'true' anyone can register
     69   //  * If 'false' only admin can
     70   //  */
     71   // const bool allow_registrations;
     72 
     73   // /**
     74   //  * If 'true' account can delete themselves
     75   //  * If 'false' only admin can delete accounts
     76   // */
     77   // const bool allow_deletions;
     78 
     79   // /**
     80   //  * If 'true' anyone can edit their name
     81   //  * If 'false' only admin can
     82   //  */
     83   // const bool allow_edit_name;
     84 
     85   // /**
     86   //  * If 'true' anyone can edit their cashout account
     87   //  * If 'false' only admin can
     88   //  */
     89   // const bool allow_edit_cashout_payto_uri;
     90 
     91   // /**
     92   //  * Default debt limit for newly created accounts
     93   //  */
     94   // const struct TALER_AmountNBO default_debit_threshold; 
     95 
     96   // /**
     97   //  * Stand in  string for the TAN channel. Not used in the callbacks
     98   //  * when used needs to be addapted
     99   //  * TAN channels supported by the server
    100   //  */
    101   // const char *supported_tan_channels;
    102 
    103   // /**
    104   //  * Wire transfer type supported by the bank.
    105   //  * Defaults to 'iban' is missing
    106   //  */
    107   // const char *wire_type;
    108 
    109 };
    110 
    111 /**
    112  * Response details for a config request
    113  */
    114 struct TALER_BANK_ConfigResponse
    115 {
    116 
    117   /**
    118    * HTTP response
    119    */
    120   struct TALER_BANK_HttpResponse hr;
    121 
    122   /**
    123    * Details returned depending on the @e http_status.
    124    */
    125   union
    126   {
    127 
    128     /**
    129      * Details if status was request was succesfull
    130      */
    131     struct
    132     {
    133 
    134       /**
    135        * Protocol compatibility evaluation.
    136        */
    137       enum TALER_BANK_VersionCompatibility version_compa;
    138 
    139       /**
    140        * Config data returned by /config.
    141        */
    142       struct TALER_BANK_ConfigInformation configi;
    143 
    144     } ok;
    145 
    146   } details;
    147 
    148 };
    149 
    150 
    151 /**
    152  * Function called with information about the bank.
    153  *
    154  * @param cls closure
    155  * @param vr response data
    156  */
    157 typedef void
    158 (*TALER_BANK_ConfigCallback) (
    159   void *cls,
    160   const struct TALER_BANK_ConfigResponse *vr);
    161 
    162 
    163 /**
    164  * Handle for the get config request.
    165  */
    166 struct TALER_BANK_GetConfigHandle;
    167 
    168 
    169 /**
    170  * Obtain config inforamtion about the connected Bank
    171  * @param ctx
    172  * @param url
    173  * @return NULL on failure
    174  */
    175 struct TALER_BANK_GetConfigHandle *
    176 TALER_BANK_get_config ( struct GNUNET_CURL_Context *ctx,
    177                         const char *url,
    178                         TALER_BANK_ConfigCallback config_cb,
    179                         void *config_cb_cls);
    180 
    181 /**
    182  * Cancel config request. Handles the GNUNet canelation.
    183  */
    184 void
    185 TALER_BANK_get_config_cancel ( struct TALER_BANK_GetConfigHandle *bank);
    186 
    187 
    188 #endif //BANK_API_GET_CONFIG_H