summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-08-10 16:31:06 -0400
committerJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-08-10 16:31:06 -0400
commit050de4d39ca58446b02887bf5770864589e788cb (patch)
tree87725fd978f9c032151958ac2061d112865be827 /src
parent280bbb526c245ac69762e989816cb4c4848cd22c (diff)
downloadmerchant-050de4d39ca58446b02887bf5770864589e788cb.tar.gz
merchant-050de4d39ca58446b02887bf5770864589e788cb.tar.bz2
merchant-050de4d39ca58446b02887bf5770864589e788cb.zip
add await_refund_obtained option to GET /orders/ in merchant lib
Diffstat (limited to 'src')
-rw-r--r--src/include/taler_merchant_service.h3
-rw-r--r--src/lib/merchant_api_wallet_get_order.c9
-rw-r--r--src/testing/testing_api_cmd_wallet_get_order.c1
3 files changed, 13 insertions, 0 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h
index 17d0f16f..46d14ead 100644
--- a/src/include/taler_merchant_service.h
+++ b/src/include/taler_merchant_service.h
@@ -1549,6 +1549,8 @@ typedef void
* @param min_refund long poll for the service to approve a refund exceeding this value;
* use NULL to not wait for any refund (only for payment). Only makes sense
* with a non-zero @a timeout. Can be NULL.
+ * @param await_refund_obtained long poll for the order's refunds to be
+ * picked up by the wallet.
* @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
@@ -1561,6 +1563,7 @@ TALER_MERCHANT_wallet_order_get (struct GNUNET_CURL_Context *ctx,
struct GNUNET_TIME_Relative timeout,
const char *session_id,
const struct TALER_Amount *min_refund,
+ bool await_refund_obtained,
TALER_MERCHANT_OrderWalletGetCallback cb,
void *cb_cls);
diff --git a/src/lib/merchant_api_wallet_get_order.c b/src/lib/merchant_api_wallet_get_order.c
index 7f6b1edb..7bfdf709 100644
--- a/src/lib/merchant_api_wallet_get_order.c
+++ b/src/lib/merchant_api_wallet_get_order.c
@@ -381,6 +381,8 @@ handle_wallet_get_order_finished (void *cls,
* @param min_refund long poll for the service to approve a refund exceeding this value;
* use NULL to not wait for any refund (only for payment). Only makes sense
* with a non-zero @a timeout. Can be NULL.
+ * @param await_refund_obtained long poll for the order's refunds to be
+ * picked up by the wallet.
* @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
@@ -393,6 +395,7 @@ TALER_MERCHANT_wallet_order_get (struct GNUNET_CURL_Context *ctx,
struct GNUNET_TIME_Relative timeout,
const char *session_id,
const struct TALER_Amount *min_refund,
+ bool await_refund_obtained,
TALER_MERCHANT_OrderWalletGetCallback cb,
void *cb_cls)
{
@@ -444,6 +447,12 @@ TALER_MERCHANT_wallet_order_get (struct GNUNET_CURL_Context *ctx,
(NULL != min_refund)
? TALER_amount2s (min_refund)
: NULL,
+ await_refund_obtained
+ ? "await_refund_obtained"
+ : NULL,
+ await_refund_obtained
+ ? "yes"
+ : NULL,
NULL);
GNUNET_free (path);
}
diff --git a/src/testing/testing_api_cmd_wallet_get_order.c b/src/testing/testing_api_cmd_wallet_get_order.c
index 76d620f7..3ebeda4e 100644
--- a/src/testing/testing_api_cmd_wallet_get_order.c
+++ b/src/testing/testing_api_cmd_wallet_get_order.c
@@ -301,6 +301,7 @@ wallet_get_order_run (void *cls,
GNUNET_TIME_UNIT_ZERO,
NULL,
NULL,
+ false,
&wallet_get_order_cb,
gos);
}