diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-10-14 23:02:02 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-10-14 23:02:02 +0200 |
commit | e98ca0d39480b9cb23f7d0f620d9ca10d9afa7aa (patch) | |
tree | 3c44c2f95afab72cb3ff64f7311a74fb26b56135 /src/include | |
parent | bf9641e1512338edd48624f23e6be356cf251ef4 (diff) | |
download | merchant-e98ca0d39480b9cb23f7d0f620d9ca10d9afa7aa.tar.gz merchant-e98ca0d39480b9cb23f7d0f620d9ca10d9afa7aa.tar.bz2 merchant-e98ca0d39480b9cb23f7d0f620d9ca10d9afa7aa.zip |
implementing long-polling test commands for wallet get order operation (#6466)
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_merchant_service.h | 6 | ||||
-rw-r--r-- | src/include/taler_merchant_testing_lib.h | 37 |
2 files changed, 35 insertions, 8 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h index e34226a0..cd16caca 100644 --- a/src/include/taler_merchant_service.h +++ b/src/include/taler_merchant_service.h @@ -1466,7 +1466,7 @@ struct TALER_MERCHANT_OrderWalletGetHandle; /** - * Callback to process a GET /orders/$ID request + * Callback to process a GET /orders/$ID response * * @param cls closure * @param hr HTTP response details @@ -1509,7 +1509,7 @@ typedef void * @param timeout timeout to use in long polling (how long may the server wait to reply * before generating an unpaid response). Note that this is just provided to * the server, we as client will block until the response comes back or until - * #TALER_MERCHANT_order_get_cancel() is called. + * #TALER_MERCHANT_wallet_order_get_cancel() is called. * @param session_id for which session should the payment status be checked. Use * NULL to disregard sessions. * @param min_refund long poll for the service to approve a refund exceeding this value; @@ -1825,7 +1825,7 @@ typedef void * @param timeout timeout to use in long polling (how long may the server wait to reply * before generating an unpaid response). Note that this is just provided to * the server, we as client will block until the response comes back or until - * #TALER_MERCHANT_order_get_cancel() is called. + * #TALER_MERCHANT_merchant_order_get_cancel() is called. * @param cb callback which will work the response gotten from the backend * @param cb_cls closure to pass to @a cb * @return handle for this operation, NULL upon errors diff --git a/src/include/taler_merchant_testing_lib.h b/src/include/taler_merchant_testing_lib.h index ac500766..8b53c324 100644 --- a/src/include/taler_merchant_testing_lib.h +++ b/src/include/taler_merchant_testing_lib.h @@ -575,6 +575,13 @@ TALER_TESTING_cmd_merchant_get_orders (const char *label, /** * Start a long poll for GET /private/orders. + * + * FIXME: needs additional arguments to specify range to long poll for! + * + * @param label the command label + * @param merchant_url base URL of the merchant which will + * serve the request. + * @param timeout how long to wait for the request to complete */ struct TALER_TESTING_Command TALER_TESTING_cmd_poll_orders_start (const char *label, @@ -584,6 +591,10 @@ TALER_TESTING_cmd_poll_orders_start (const char *label, /** * Complete a long poll for GET /private/orders. + * + * @param label the command label + * @param http_status expected HTTP response code + * @param poll_start_reference reference to the #TALER_TESTING_cmd_poll_orders_start command */ struct TALER_TESTING_Command TALER_TESTING_cmd_poll_orders_conclude (const char *label, @@ -614,23 +625,39 @@ TALER_TESTING_cmd_wallet_get_order (const char *label, /** - * Start a long poll for GET /private/orders/$ORDER_ID. + * Start a long poll for GET /orders/$ORDER_ID. + * + * @param label the command label + * @param merchant_url base URL of the merchant which will + * serve the request. + * @param order_ref reference to a command that created an order. + * @param timeout how long to wait for the request to complete + * @param await_refund NULL to not wait for refund, amount of value + * zero to wait for any refund amount, non-zero to poll + * for refund exceeding the given amount */ struct TALER_TESTING_Command TALER_TESTING_cmd_wallet_poll_order_start ( const char *label, const char *merchant_url, - const char *order_id, - struct GNUNET_TIME_Relative timeout); + const char *order_ref, + struct GNUNET_TIME_Relative timeout, + const struct TALER_Amount *await_refund); /** - * Complete a long poll for GET /private/orders/$ORDER_ID. + * Complete a long poll for GET /orders/$ORDER_ID. + * + * @param label the command label + * @param expected_http_status expected HTTP response code + * @param expected_refund_amount refund expected, NULL for no refund expected + * @param poll_start_reference reference to the #TALER_TESTING_cmd_wallet_poll_order_start command */ struct TALER_TESTING_Command TALER_TESTING_cmd_wallet_poll_order_conclude ( const char *label, - unsigned int http_status, + unsigned int expected_http_status, + const char *expected_refund_amount, const char *poll_start_reference); |