aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-10-31 14:45:15 +0100
committerChristian Grothoff <christian@grothoff.org>2017-10-31 14:45:15 +0100
commitbeeece1d6a011a87d43318b3d829d9a243f21b58 (patch)
treec977cd5927a89360b6dccdf1f7d4abbef319d30e /src/include
parent2f2930f1ba0f1708fc4455c66173fd61188a3369 (diff)
add TALER_EXCHANGE_reserve_withdraw2 function for easy withdrawal of tips
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_exchange_service.h46
1 files changed, 40 insertions, 6 deletions
diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h
index 3b4562a69..fadcbf8b2 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -966,12 +966,14 @@ typedef void
/**
- * Withdraw a coin from the exchange using a /reserve/withdraw request. This
- * API is typically used by a wallet. Note that to ensure that no
- * money is lost in case of hardware failures, the caller must have
- * committed (most of) the arguments to disk before calling, and be
- * ready to repeat the request with the same arguments in case of
- * failures.
+ * Withdraw a coin from the exchange using a /reserve/withdraw
+ * request. This API is typically used by a wallet to withdraw from a
+ * reserve.
+ *
+ * Note that to ensure that no money is lost in case of hardware
+ * failures, the caller must have committed (most of) the arguments to
+ * disk before calling, and be ready to repeat the request with the
+ * same arguments in case of failures.
*
* @param exchange the exchange handle; the exchange must be ready to operate
* @param pk kind of coin to create
@@ -994,6 +996,38 @@ TALER_EXCHANGE_reserve_withdraw (struct TALER_EXCHANGE_Handle *exchange,
/**
+ * Withdraw a coin from the exchange using a /reserve/withdraw
+ * request. This API is typically used by a wallet to withdraw a tip
+ * where the reserve's signature was created by the merchant already.
+ *
+ * Note that to ensure that no money is lost in case of hardware
+ * failures, the caller must have committed (most of) the arguments to
+ * disk before calling, and be ready to repeat the request with the
+ * same arguments in case of failures.
+ *
+ * @param exchange the exchange handle; the exchange must be ready to operate
+ * @param pk kind of coin to create
+ * @param reserve_sig signature from the reserve authorizing the withdrawal
+ * @param reserve_pub public key of the reserve to withdraw from
+ * @param ps secrets of the planchet
+ * caller must have committed this value to disk before the call (with @a pk)
+ * @param res_cb the callback to call when the final result for this request is available
+ * @param res_cb_cls closure for @a res_cb
+ * @return NULL
+ * if the inputs are invalid (i.e. denomination key not with this exchange).
+ * In this case, the callback is not called.
+ */
+struct TALER_EXCHANGE_ReserveWithdrawHandle *
+TALER_EXCHANGE_reserve_withdraw2 (struct TALER_EXCHANGE_Handle *exchange,
+ const struct TALER_EXCHANGE_DenomPublicKey *pk,
+ const struct TALER_ReserveSignatureP *reserve_sig,
+ const struct TALER_ReservePublicKeyP *reserve_pub,
+ const struct TALER_PlanchetSecretsP *ps,
+ TALER_EXCHANGE_ReserveWithdrawResultCallback res_cb,
+ void *res_cb_cls);
+
+
+/**
* Cancel a withdraw status request. This function cannot be used
* on a request handle if a response is already served for it.
*