delete-private-tokens-SERIAL.h (3513B)
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 Lesser General Public License as published by the Free Software 7 Foundation; either version 2.1, 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 Lesser General Public License for more details. 12 13 You should have received a copy of the GNU Lesser General Public License along with 14 TALER; see the file COPYING.LGPL. If not, see 15 <http://www.gnu.org/licenses/> 16 */ 17 /** 18 * @file src/include/taler/merchant/delete-private-tokens-SERIAL.h 19 * @brief C interface for DELETE /private/tokens/$SERIAL 20 * @author Christian Grothoff 21 */ 22 #ifndef _TALER_MERCHANT__DELETE_PRIVATE_TOKENS_SERIAL_H 23 #define _TALER_MERCHANT__DELETE_PRIVATE_TOKENS_SERIAL_H 24 25 #include <taler/merchant/common.h> 26 27 28 /** 29 * Handle for a DELETE /private/tokens/$SERIAL operation. 30 */ 31 struct TALER_MERCHANT_DeletePrivateTokensSerialHandle; 32 33 34 /** 35 * Set up DELETE /private/tokens/$SERIAL operation. 36 * Note that you must explicitly start the operation after setup. 37 * 38 * @param ctx curl context 39 * @param url merchant backend base URL 40 * @param instance_id identifier of the instance 41 * @param serial serial number of the token to delete 42 * @return handle to operation, NULL on error 43 */ 44 struct TALER_MERCHANT_DeletePrivateTokensSerialHandle * 45 TALER_MERCHANT_delete_private_tokens_serial_create ( 46 struct GNUNET_CURL_Context *ctx, 47 const char *url, 48 const char *instance_id, 49 uint64_t serial); 50 51 52 /** 53 * Response details for a DELETE /private/tokens/$SERIAL request. 54 */ 55 struct TALER_MERCHANT_DeletePrivateTokensSerialResponse 56 { 57 /** 58 * HTTP response details. 59 */ 60 struct TALER_MERCHANT_HttpResponse hr; 61 }; 62 63 64 #ifndef TALER_MERCHANT_DELETE_PRIVATE_TOKENS_SERIAL_RESULT_CLOSURE 65 /** 66 * Type of the closure used by 67 * the #TALER_MERCHANT_DeletePrivateTokensSerialCallback. 68 */ 69 #define TALER_MERCHANT_DELETE_PRIVATE_TOKENS_SERIAL_RESULT_CLOSURE void 70 #endif /* TALER_MERCHANT_DELETE_PRIVATE_TOKENS_SERIAL_RESULT_CLOSURE */ 71 72 /** 73 * Type of the function that receives the result of a 74 * DELETE /private/tokens/$SERIAL request. 75 * 76 * @param cls closure 77 * @param result result returned by the HTTP server 78 */ 79 typedef void 80 (*TALER_MERCHANT_DeletePrivateTokensSerialCallback)( 81 TALER_MERCHANT_DELETE_PRIVATE_TOKENS_SERIAL_RESULT_CLOSURE *cls, 82 const struct TALER_MERCHANT_DeletePrivateTokensSerialResponse *result); 83 84 85 /** 86 * Start DELETE /private/tokens/$SERIAL operation. 87 * 88 * @param[in,out] handle operation to start 89 * @param cb function to call with the result 90 * @param cb_cls closure for @a cb 91 * @return status code, #TALER_EC_NONE on success 92 */ 93 enum TALER_ErrorCode 94 TALER_MERCHANT_delete_private_tokens_serial_start ( 95 struct TALER_MERCHANT_DeletePrivateTokensSerialHandle *handle, 96 TALER_MERCHANT_DeletePrivateTokensSerialCallback cb, 97 TALER_MERCHANT_DELETE_PRIVATE_TOKENS_SERIAL_RESULT_CLOSURE *cb_cls); 98 99 100 /** 101 * Cancel DELETE /private/tokens/$SERIAL operation. 102 * This function must not be called by clients after the 103 * callback has been invoked. 104 * 105 * @param[in] handle operation to cancel 106 */ 107 void 108 TALER_MERCHANT_delete_private_tokens_serial_cancel ( 109 struct TALER_MERCHANT_DeletePrivateTokensSerialHandle *handle); 110 111 112 #endif /* _TALER_MERCHANT__DELETE_PRIVATE_TOKENS_SERIAL_H */