From 7891e62bf98bd884c8c993ae698f9a985dbacfbd Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 16 Dec 2023 17:54:16 +0800 Subject: partial implementation of protocol v6: GET with additional filters, POST not done --- src/include/taler_merchant_service.h | 79 ++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) (limited to 'src/include/taler_merchant_service.h') diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h index 0abef2a8..e8aad3d0 100644 --- a/src/include/taler_merchant_service.h +++ b/src/include/taler_merchant_service.h @@ -29,6 +29,11 @@ #include #include +/** + * Library version (in hex) for compatibility tests. + */ +#define TALER_MERCHANT_SERVICE_VERSION 0x00090400 + /** * General information about the HTTP response we obtained @@ -1978,6 +1983,43 @@ TALER_MERCHANT_orders_post2 ( void *cb_cls); +/** + * POST to /orders at the backend to setup an order and obtain + * the order ID (which may have been set by the front-end). + * + * @param ctx execution context + * @param backend_url URL of the backend + * @param order basic information about this purchase, to be extended by the backend + * @param session_id session ID to set for the order + * @param refund_delay how long can refunds happen for this order; 0 to use + * absolute value from contract (or not allow refunds). + * @param payment_target desired payment target identifier (to select merchant bank details) + * @param inventory_products_length length of the @a inventory_products array + * @param inventory_products products to add to the order from the inventory + * @param uuids_length length of the @a uuids array + * @param uuids array of UUIDs with locks on @a inventory_products + * @param create_token whether to create a claim token + * @param cb the callback to call when a reply for this request is available + * @param cb_cls closure for @a cb + * @return a handle for this request, NULL on error + */ +struct TALER_MERCHANT_PostOrdersHandle * +TALER_MERCHANT_orders_post3 ( + struct GNUNET_CURL_Context *ctx, + const char *backend_url, + const json_t *order, + const char *session_id, + struct GNUNET_TIME_Relative refund_delay, + const char *payment_target, + unsigned int inventory_products_length, + const struct TALER_MERCHANT_InventoryProduct inventory_products[], + unsigned int uuids_length, + const char *uuids[static uuids_length], + bool create_token, + TALER_MERCHANT_PostOrdersCallback cb, + void *cb_cls); + + /** * Cancel a POST /orders request. This function cannot be used * on a request handle if a response is already served for it. @@ -2137,6 +2179,43 @@ TALER_MERCHANT_orders_get2 ( void *cb_cls); +/** + * Make a GET /orders request with more filters. + * + * @param ctx the context + * @param backend_url HTTP base URL for the backend + * @param paid filter on payment status + * @param refunded filter on refund status + * @param wired filter on wire transfer status + * @param session_id filter by session ID + * @param fulfillment_url filter by fulfillment URL + * @param date range limit by date + * @param start_row range limit by order table row + * @param delta range from which @a date and @a start_row apply, positive + * to return delta items after the given limit(s), negative to + * return delta items before the given limit(s) + * @param timeout how long to wait (long polling) of zero results match the query + * @param cb function to call with the backend's inventory information + * @param cb_cls closure for @a cb + * @return the request handle; NULL upon error + */ +struct TALER_MERCHANT_OrdersGetHandle * +TALER_MERCHANT_orders_get3 ( + struct GNUNET_CURL_Context *ctx, + const char *backend_url, + enum TALER_EXCHANGE_YesNoAll paid, + enum TALER_EXCHANGE_YesNoAll refunded, + enum TALER_EXCHANGE_YesNoAll wired, + const char *session_id, + const char *fulfillment_url, + struct GNUNET_TIME_Timestamp date, + uint64_t start_row, + int64_t delta, + struct GNUNET_TIME_Relative timeout, + TALER_MERCHANT_OrdersGetCallback cb, + void *cb_cls); + + /** * Cancel GET /orders operation. * -- cgit v1.2.3