delete-private-accounts-H_WIRE.h (3425B)
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 include/taler/taler-merchant/delete-private-accounts-H_WIRE.h 19 * @brief C interface for DELETE /private/accounts/$H_WIRE 20 * @author Christian Grothoff 21 */ 22 #ifndef _TALER_MERCHANT__DELETE_PRIVATE_ACCOUNTS_H_WIRE_H 23 #define _TALER_MERCHANT__DELETE_PRIVATE_ACCOUNTS_H_WIRE_H 24 25 #include <taler/taler-merchant/common.h> 26 27 28 /** 29 * Handle for a DELETE /private/accounts/$H_WIRE operation. 30 */ 31 struct TALER_MERCHANT_DeletePrivateAccountHandle; 32 33 34 /** 35 * Set up DELETE /private/accounts/$H_WIRE 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 h_wire hash of the wire details identifying the account to delete 41 * @return handle to operation, NULL on error 42 */ 43 struct TALER_MERCHANT_DeletePrivateAccountHandle * 44 TALER_MERCHANT_delete_private_account_create ( 45 struct GNUNET_CURL_Context *ctx, 46 const char *url, 47 const struct TALER_MerchantWireHashP *h_wire); 48 49 50 /** 51 * Response details for a DELETE /private/accounts/$H_WIRE request. 52 */ 53 struct TALER_MERCHANT_DeletePrivateAccountResponse 54 { 55 /** 56 * HTTP response details. 57 */ 58 struct TALER_MERCHANT_HttpResponse hr; 59 }; 60 61 62 #ifndef TALER_MERCHANT_DELETE_PRIVATE_ACCOUNT_RESULT_CLOSURE 63 /** 64 * Type of the closure used by 65 * the #TALER_MERCHANT_DeletePrivateAccountCallback. 66 */ 67 #define TALER_MERCHANT_DELETE_PRIVATE_ACCOUNT_RESULT_CLOSURE void 68 #endif /* TALER_MERCHANT_DELETE_PRIVATE_ACCOUNT_RESULT_CLOSURE */ 69 70 /** 71 * Type of the function that receives the result of a 72 * DELETE /private/accounts/$H_WIRE request. 73 * 74 * @param cls closure 75 * @param result result returned by the HTTP server 76 */ 77 typedef void 78 (*TALER_MERCHANT_DeletePrivateAccountCallback)( 79 TALER_MERCHANT_DELETE_PRIVATE_ACCOUNT_RESULT_CLOSURE *cls, 80 const struct TALER_MERCHANT_DeletePrivateAccountResponse *result); 81 82 83 /** 84 * Start DELETE /private/accounts/$H_WIRE operation. 85 * 86 * @param[in,out] handle operation to start 87 * @param cb function to call with the result 88 * @param cb_cls closure for @a cb 89 * @return status code, #TALER_EC_NONE on success 90 */ 91 enum TALER_ErrorCode 92 TALER_MERCHANT_delete_private_account_start ( 93 struct TALER_MERCHANT_DeletePrivateAccountHandle *handle, 94 TALER_MERCHANT_DeletePrivateAccountCallback cb, 95 TALER_MERCHANT_DELETE_PRIVATE_ACCOUNT_RESULT_CLOSURE *cb_cls); 96 97 98 /** 99 * Cancel DELETE /private/accounts/$H_WIRE operation. 100 * This function must not be called by clients after the 101 * callback has been invoked. 102 * 103 * @param[in] handle operation to cancel 104 */ 105 void 106 TALER_MERCHANT_delete_private_account_cancel ( 107 struct TALER_MERCHANT_DeletePrivateAccountHandle *handle); 108 109 110 #endif /* _TALER_MERCHANT__DELETE_PRIVATE_ACCOUNTS_H_WIRE_H */