exchange

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

delete-purses-PURSE_PUB.h (3308B)


      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/delete-purses-PURSE_PUB.h
     18  * @brief C interface for DELETE /purses/$PURSE_PUB
     19  * @author Christian Grothoff
     20  */
     21 #ifndef _TALER_EXCHANGE__DELETE_PURSES_PURSE_PUB_H
     22 #define _TALER_EXCHANGE__DELETE_PURSES_PURSE_PUB_H
     23 
     24 #include <taler/taler-exchange/common.h>
     25 
     26 /**
     27  * Handle for an operation to DELETE /purses/$PURSE_PUB.
     28  */
     29 struct TALER_EXCHANGE_DeletePursesHandle;
     30 
     31 
     32 /**
     33  * Set up DELETE /purses/$PURSE_PUB operation.
     34  * Note that you must explicitly start the operation after setup.
     35  *
     36  * Asks the exchange to delete a purse. Will only succeed if
     37  * the purse was not yet merged and did not yet time out.
     38  *
     39  * @param ctx CURL context
     40  * @param url exchange base URL
     41  * @param purse_priv private key of the purse
     42  * @return handle to operation, NULL upon error
     43  */
     44 struct TALER_EXCHANGE_DeletePursesHandle *
     45 TALER_EXCHANGE_delete_purses_create (
     46   struct GNUNET_CURL_Context *ctx,
     47   const char *url,
     48   const struct TALER_PurseContractPrivateKeyP *purse_priv);
     49 
     50 
     51 /**
     52  * Response generated for a purse deletion request.
     53  */
     54 struct TALER_EXCHANGE_DeletePursesResponse
     55 {
     56   /**
     57    * Full HTTP response.
     58    */
     59   struct TALER_EXCHANGE_HttpResponse hr;
     60 };
     61 
     62 
     63 #ifndef TALER_EXCHANGE_DELETE_PURSES_RESULT_CLOSURE
     64 /**
     65  * Type of the closure used by
     66  * the #TALER_EXCHANGE_DeletePursesCallback.
     67  */
     68 #define TALER_EXCHANGE_DELETE_PURSES_RESULT_CLOSURE void
     69 #endif /* TALER_EXCHANGE_DELETE_PURSES_RESULT_CLOSURE */
     70 
     71 /**
     72  * Function called with information about the deletion
     73  * of a purse.
     74  *
     75  * @param cls closure
     76  * @param pdr HTTP response data
     77  */
     78 typedef void
     79 (*TALER_EXCHANGE_DeletePursesCallback) (
     80   TALER_EXCHANGE_DELETE_PURSES_RESULT_CLOSURE *cls,
     81   const struct TALER_EXCHANGE_DeletePursesResponse *pdr);
     82 
     83 
     84 /**
     85  * Start DELETE /purses/$PURSE_PUB operation.
     86  *
     87  * @param[in,out] dph operation to start
     88  * @param cb function to call with the exchange's result
     89  * @param cb_cls closure for @a cb
     90  * @return status code, #TALER_EC_NONE on success
     91  */
     92 enum TALER_ErrorCode
     93 TALER_EXCHANGE_delete_purses_start (
     94   struct TALER_EXCHANGE_DeletePursesHandle *dph,
     95   TALER_EXCHANGE_DeletePursesCallback cb,
     96   TALER_EXCHANGE_DELETE_PURSES_RESULT_CLOSURE *cb_cls);
     97 
     98 
     99 /**
    100  * Cancel DELETE /purses/$PURSE_PUB operation.  This function must not be
    101  * called by clients after the TALER_EXCHANGE_DeletePursesCallback has been
    102  * invoked (as in those cases it'll be called internally by the
    103  * implementation already).
    104  *
    105  * @param[in] dph operation to cancel
    106  */
    107 void
    108 TALER_EXCHANGE_delete_purses_cancel (
    109   struct TALER_EXCHANGE_DeletePursesHandle *dph);
    110 
    111 #endif