From 031e2fed3aae424bc47f6634fa52415729c75ed3 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 18 May 2021 12:06:29 +0200 Subject: add C client API for DELETE /transfers/ID operation (#6876) --- src/include/taler_merchant_service.h | 55 +++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h index 1b7ccc54..9e7cf8f8 100644 --- a/src/include/taler_merchant_service.h +++ b/src/include/taler_merchant_service.h @@ -2008,7 +2008,7 @@ struct TALER_MERCHANT_OrderDeleteHandle; /** - * Function called with the result of the DELETE /order/$ID operation. + * Function called with the result of the DELETE /orders/$ID operation. * * @param cls closure * @param hr HTTP response details @@ -2780,6 +2780,57 @@ TALER_MERCHANT_transfers_post_cancel ( struct TALER_MERCHANT_PostTransfersHandle *pth); +/** + * Handle for a DELETE /transfers/ID operation. + */ +struct TALER_MERCHANT_TransferDeleteHandle; + + +/** + * Function called with the result of the DELETE /transfers/$ID operation. + * + * @param cls closure + * @param hr HTTP response details + */ +typedef void +(*TALER_MERCHANT_TransferDeleteCallback)( + void *cls, + const struct TALER_MERCHANT_HttpResponse *hr); + + +/** + * Delete an incoming wire transfer at an instance of a backend. This + * will only succeed if the exchange did not respond to the inquiry + * about the transfer. + * + * @param ctx the context + * @param backend_url HTTP base URL for the backend (top-level "default" instance + * or base URL of an instance if @a instance_id is NULL) + * @param wire_transfer_serial unique number that identifies the transfer + * @param td_cb function to call with the backend's result + * @param td_cb_cls closure for @a td_cb + * @return the request handle; NULL upon error + */ +struct TALER_MERCHANT_TransferDeleteHandle * +TALER_MERCHANT_transfer_delete ( + struct GNUNET_CURL_Context *ctx, + const char *backend_url, + uint64_t wire_transfer_serial, + TALER_MERCHANT_TransferDeleteCallback td_cb, + void *td_cb_cls); + + +/** + * Cancel deletion operation. Note that the operation may still + * succeed. + * + * @param tdh operation to cancel + */ +void +TALER_MERCHANT_transfer_delete_cancel ( + struct TALER_MERCHANT_TransferDeleteHandle *tdh); + + /** * @brief Handle to a GET /transfers operation at a merchant's backend. */ @@ -2815,6 +2866,8 @@ struct TALER_MERCHANT_TransferData /** * Serial number of the credit operation in the merchant backend. + * Needed, for example, to delete the transfer using + * #TALER_MERCHANT_transfer_delete(). */ uint64_t credit_serial; -- cgit v1.2.3