diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2024-02-10 13:15:09 +0100 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2024-02-10 13:16:05 +0100 |
commit | a63ae8bba773b5e2371ee82c23ba1172d9465bfe (patch) | |
tree | 0516e1494fa5a0d7aeb3bcdfa5e9f57b992f2691 /src/backend/taler-merchant-httpd_get-orders-ID.c | |
parent | 935f9b571d2b47f10a552980feecee76ebcc3593 (diff) |
try to fix #8353
Diffstat (limited to 'src/backend/taler-merchant-httpd_get-orders-ID.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_get-orders-ID.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/backend/taler-merchant-httpd_get-orders-ID.c b/src/backend/taler-merchant-httpd_get-orders-ID.c index 02f2997f..13ff3fc9 100644 --- a/src/backend/taler-merchant-httpd_get-orders-ID.c +++ b/src/backend/taler-merchant-httpd_get-orders-ID.c @@ -162,6 +162,12 @@ struct GetOrderData enum GNUNET_GenericReturnValue suspended; /** + * Set to YES if refunded orders should be included when + * doing repurchase detection. + */ + enum TALER_EXCHANGE_YesNoAll allow_refunded_for_repurchase; + + /** * Set to true if the client passed 'h_contract'. */ bool h_contract_provided; @@ -795,6 +801,7 @@ god_cleanup (void *cls) } +// FIXME: this function should probably be refactored... MHD_RESULT TMH_get_orders_ID (const struct TMH_RequestHandler *rh, struct MHD_Connection *connection, @@ -827,6 +834,14 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh, "token", &god->claim_token, god->claim_token_provided); + if (! (TALER_arg_to_yna (connection, + "allow_refunded_for_repurchase", + TALER_EXCHANGE_YNA_NO, + &god->allow_refunded_for_repurchase)) ) + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_GENERIC_PARAMETER_MALFORMED, + "allow_refunded_for_repurchase"); god->session_id = MHD_lookup_connection_value (connection, MHD_GET_ARGUMENT_KIND, "session_id"); @@ -1227,6 +1242,8 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh, hc->instance->settings.id, god->fulfillment_url, god->session_id, + TALER_EXCHANGE_YNA_NO != + god->allow_refunded_for_repurchase, &already_paid_order_id); if (qs < 0) { |