exchange

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

post-management-partners.h (4051B)


      1 /*
      2   This file is part of TALER
      3   Copyright (C) 2014-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 Affero 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 Affero General Public License for more details.
     12 
     13   You should have received a copy of the GNU Affero General Public License along with
     14   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15  */
     16 /**
     17  * @file include/taler/taler-exchange/post-management-partners.h
     18  * @brief C interface for POST /management/partners
     19  * @author Christian Grothoff
     20  */
     21 #ifndef _TALER_EXCHANGE__POST_MANAGEMENT_PARTNERS_H
     22 #define _TALER_EXCHANGE__POST_MANAGEMENT_PARTNERS_H
     23 
     24 #include <taler/taler-exchange/common.h>
     25 
     26 /**
     27  * Handle for an operation to POST /management/partners.
     28  */
     29 struct TALER_EXCHANGE_PostManagementPartnersHandle;
     30 
     31 
     32 /**
     33  * Set up POST /management/partners operation.
     34  * Note that you must explicitly start the operation after setup.
     35  *
     36  * @param ctx the context
     37  * @param url HTTP base URL for the exchange
     38  * @param partner_pub the offline signing key of the partner
     39  * @param start_date validity period start
     40  * @param end_date validity period end
     41  * @param wad_frequency how often will we do wad transfers to this partner
     42  * @param wad_fee what is the wad fee to this partner
     43  * @param partner_base_url what is the base URL of the @a partner_pub exchange
     44  * @param master_sig the signature
     45  * @return handle to operation, NULL on error
     46  */
     47 struct TALER_EXCHANGE_PostManagementPartnersHandle *
     48 TALER_EXCHANGE_post_management_partners_create (
     49   struct GNUNET_CURL_Context *ctx,
     50   const char *url,
     51   const struct TALER_MasterPublicKeyP *partner_pub,
     52   struct GNUNET_TIME_Timestamp start_date,
     53   struct GNUNET_TIME_Timestamp end_date,
     54   struct GNUNET_TIME_Relative wad_frequency,
     55   const struct TALER_Amount *wad_fee,
     56   const char *partner_base_url,
     57   const struct TALER_MasterSignatureP *master_sig);
     58 
     59 
     60 /**
     61  * Response when adding a partner exchange.
     62  */
     63 struct TALER_EXCHANGE_PostManagementPartnersResponse
     64 {
     65   /**
     66    * HTTP response data.
     67    */
     68   struct TALER_EXCHANGE_HttpResponse hr;
     69 };
     70 
     71 
     72 #ifndef TALER_EXCHANGE_POST_MANAGEMENT_PARTNERS_RESULT_CLOSURE
     73 /**
     74  * Type of the closure used by
     75  * the #TALER_EXCHANGE_PostManagementPartnersCallback.
     76  */
     77 #define TALER_EXCHANGE_POST_MANAGEMENT_PARTNERS_RESULT_CLOSURE void
     78 #endif /* TALER_EXCHANGE_POST_MANAGEMENT_PARTNERS_RESULT_CLOSURE */
     79 
     80 /**
     81  * Type of the function that receives the result of a
     82  * POST /management/partners request.
     83  *
     84  * @param cls closure
     85  * @param result result returned by the HTTP server
     86  */
     87 typedef void
     88 (*TALER_EXCHANGE_PostManagementPartnersCallback)(
     89   TALER_EXCHANGE_POST_MANAGEMENT_PARTNERS_RESULT_CLOSURE *cls,
     90   const struct TALER_EXCHANGE_PostManagementPartnersResponse *result);
     91 
     92 
     93 /**
     94  * Start POST /management/partners operation.
     95  *
     96  * @param[in,out] pmph operation to start
     97  * @param cb function to call with the exchange's result
     98  * @param cb_cls closure for @a cb
     99  * @return status code, #TALER_EC_NONE on success
    100  */
    101 enum TALER_ErrorCode
    102 TALER_EXCHANGE_post_management_partners_start (
    103   struct TALER_EXCHANGE_PostManagementPartnersHandle *pmph,
    104   TALER_EXCHANGE_PostManagementPartnersCallback cb,
    105   TALER_EXCHANGE_POST_MANAGEMENT_PARTNERS_RESULT_CLOSURE *cb_cls);
    106 
    107 
    108 /**
    109  * Cancel POST /management/partners operation.  This function must not be
    110  * called by clients after the TALER_EXCHANGE_PostManagementPartnersCallback
    111  * has been invoked (as in those cases it'll be called internally by the
    112  * implementation already).
    113  *
    114  * @param[in] pmph operation to cancel
    115  */
    116 void
    117 TALER_EXCHANGE_post_management_partners_cancel (
    118   struct TALER_EXCHANGE_PostManagementPartnersHandle *pmph);
    119 
    120 
    121 
    122 #endif /* _TALER_EXCHANGE__POST_MANAGEMENT_PARTNERS_H */