diff options
Diffstat (limited to 'src/include/taler_merchant_service.h')
-rw-r--r-- | src/include/taler_merchant_service.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h index eaf85caf..0ed6856e 100644 --- a/src/include/taler_merchant_service.h +++ b/src/include/taler_merchant_service.h @@ -28,6 +28,60 @@ #include <jansson.h> +/* ********************* /map/{in,out} *********************** */ + +struct TALER_MERCHANT_MapOutOperation; + +typedef void +(*TALER_MERCHANT_MapOperationCallback) (void *cls, + unsigned int http_status, + const json_t *body); + +/** + * Issue a /map/out request to the backend. + * + * @param ctx execution context + * @param backend_uri base URL of the merchant backend + * @param h_contract hashcode of `contract` + * @param map_in_cb callback which will work the response gotten from the backend + * @param map_in_cb_cls closure to pass to @a history_cb + * @return handle for this operation, NULL upon errors + */ +struct TALER_MERCHANT_MapOperation * +TALER_MERCHANT_map_out (struct GNUNET_CURL_Context *ctx, + const char *backend_uri, + const struct GNUNET_HashCode *h_contract, + TALER_MERCHANT_MapOperationCallback map_cb, + void *map_cb_cls); + +/** + * Issue a /map/in request to the backend. + * + * @param ctx execution context + * @param backend_uri base URL of the merchant backend + * @param contract contract to store + * @param h_contract hashcode of `contract` + * @param map_in_cb callback which will work the response gotten from the backend + * @param map_in_cb_cls closure to pass to @a history_cb + * @return handle for this operation, NULL upon errors + */ +struct TALER_MERCHANT_MapOperation * +TALER_MERCHANT_map_in (struct GNUNET_CURL_Context *ctx, + const char *backend_uri, + const json_t *contract, + const struct GNUNET_HashCode *h_contract, + TALER_MERCHANT_MapOperationCallback map_cb, + void *map_cb_cls); + +/** + * Cancel a /map/in request. + * + * @param mio handle to the request to be canceled + */ +void +TALER_MERCHANT_map_cancel (struct TALER_MERCHANT_MapOperation *mo); + + /* ********************* /contract *********************** */ |