merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 80434f9f0ad5fb51e2713e1c122ad5646599cb9c
parent a6b996f6a2ee55dff2c33bb9b8ef209b532c8bf3
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date:   Mon, 19 Jun 2017 11:36:57 +0200

add /refund cancel function

Diffstat:
Msrc/include/taler_merchant_service.h | 8++++++++
Msrc/lib/merchant_api_proposal.c | 2+-
Msrc/lib/merchant_api_refund.c | 18++++++++++++++++++
3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h @@ -645,4 +645,12 @@ TALER_MERCHANT_refund_increase (struct GNUNET_CURL_Context *ctx, TALER_MERCHANT_RefundIncreaseCallback cb, void *cb_cls); +/** + * Cancel a POST /refund request. + * + * @param rio the refund increasing operation to cancel + */ +void +TALER_MERCHANT_refund_increase_cancel (struct TALER_MERCHANT_RefundIncreaseOperation *rio); + #endif /* _TALER_MERCHANT_SERVICE_H */ diff --git a/src/lib/merchant_api_proposal.c b/src/lib/merchant_api_proposal.c @@ -337,7 +337,7 @@ TALER_MERCHANT_proposal_lookup (struct GNUNET_CURL_Context *ctx, /** - * Cancel a PUT /proposal request. This function cannot be used + * Cancel a POST /proposal request. This function cannot be used * on a request handle if a response is already served for it. * * @param po the proposal operation request handle diff --git a/src/lib/merchant_api_refund.c b/src/lib/merchant_api_refund.c @@ -82,6 +82,24 @@ handle_refund_increase_finished (void *cls, } /** + * Cancel a POST /refund request. + * + * @param rio the refund increasing operation to cancel + */ +void +TALER_MERCHANT_refund_increase_cancel (struct TALER_MERCHANT_RefundIncreaseOperation *rio) +{ + if (NULL != rio->job) + { + GNUNET_CURL_job_cancel (rio->job); + rio->job = NULL; + } + GNUNET_free (rio->url); + GNUNET_free (rio->json_enc); + GNUNET_free (rio); +} + +/** * Increase the refund associated to a order * * @param ctx the CURL context used to connect to the backend