merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 050de4d39ca58446b02887bf5770864589e788cb
parent 280bbb526c245ac69762e989816cb4c4848cd22c
Author: Jonathan Buchanan <jonathan.russ.buchanan@gmail.com>
Date:   Mon, 10 Aug 2020 16:31:06 -0400

add await_refund_obtained option to GET /orders/ in merchant lib

Diffstat:
Msrc/include/taler_merchant_service.h | 3+++
Msrc/lib/merchant_api_wallet_get_order.c | 9+++++++++
Msrc/testing/testing_api_cmd_wallet_get_order.c | 1+
3 files changed, 13 insertions(+), 0 deletions(-)

diff --git 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 @@ -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 @@ -301,6 +301,7 @@ wallet_get_order_run (void *cls, GNUNET_TIME_UNIT_ZERO, NULL, NULL, + false, &wallet_get_order_cb, gos); }