diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-05-02 19:25:05 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-05-02 19:25:05 +0200 |
commit | 3493795065b8fde49a5a4c06e5302b2afd03685a (patch) | |
tree | 1e30347adccee52ccd0cd9a114a9c154073b4c4c /src/include/taler_merchant_service.h | |
parent | e6931be74dc8487d5f3020f265b84145d779b45b (diff) | |
download | merchant-3493795065b8fde49a5a4c06e5302b2afd03685a.tar.gz merchant-3493795065b8fde49a5a4c06e5302b2afd03685a.tar.bz2 merchant-3493795065b8fde49a5a4c06e5302b2afd03685a.zip |
implement /refund handling
Diffstat (limited to 'src/include/taler_merchant_service.h')
-rw-r--r-- | src/include/taler_merchant_service.h | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h index 5aa5522c..5037201d 100644 --- a/src/include/taler_merchant_service.h +++ b/src/include/taler_merchant_service.h @@ -1735,6 +1735,55 @@ void TALER_MERCHANT_order_abort_cancel (struct TALER_MERCHANT_OrderAbortHandle *oah); +/** + * Handle for a POST /orders/ID/refund operation. + */ +struct TALER_MERCHANT_OrderRefundHandle; + + +/** + * Callback to process a POST /orders/ID/refund request + * + * @param cls closure + * @param http_status HTTP status code for this request + * @param ec taler-specific error code + */ +typedef void +(*TALER_MERCHANT_RefundCallback) ( + void *cls, + const struct TALER_MERCHANT_HttpResponse *hr); + + +/** + * Increase the refund granted for an order + * + * @param ctx the CURL context used to connect to the backend + * @param backend_url backend's base URL, including final "/" + * @param order_id id of the order whose refund is to be increased + * @param refund amount to which increase the refund + * @param reason human-readable reason justifying the refund + * @param cb callback processing the response from /refund + * @param cb_cls closure for cb + */ +struct TALER_MERCHANT_OrderRefundHandle +TALER_MERCHANT_post_order_refund (struct GNUNET_CURL_Context *ctx, + const char *backend_url, + const char *order_id, + const struct TALER_Amount *refund, + const char *reason, + TALER_MERCHANT_RefundCallback cb, + void *cb_cls); + +/** + * Cancel a POST /refund request. + * + * @param rio the refund increasing operation to cancel + */ +void +TALER_MERCHANT_post_order_refund_cancel ( + struct TALER_MERCHANT_OrderRefundHandle *orh); + + /* ********************* OLD ************************** */ @@ -1840,55 +1889,6 @@ TALER_MERCHANT_refund_lookup_cancel ( struct TALER_MERCHANT_RefundLookupOperation *rlo); -/** - * Handle for a POST /refund operation. - */ -struct TALER_MERCHANT_RefundIncreaseOperation; - - -/** - * Callback to process a POST /refund request - * - * @param cls closure - * @param http_status HTTP status code for this request - * @param ec taler-specific error code - */ -typedef void -(*TALER_MERCHANT_RefundIncreaseCallback) ( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Increase the refund associated to a order - * - * @param ctx the CURL context used to connect to the backend - * @param backend_url backend's base URL, including final "/" - * @param order_id id of the order whose refund is to be increased - * @param refund amount to which increase the refund - * @param reason human-readable reason justifying the refund - * @param cb callback processing the response from /refund - * @param cb_cls closure for cb - */ -struct TALER_MERCHANT_RefundIncreaseOperation * -TALER_MERCHANT_refund_increase (struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *order_id, - const struct TALER_Amount *refund, - const char *reason, - 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); - - /* ********************* /proposal *********************** */ |