commit 5804737e0b03ebcaa8f316e16364d7d60cf30588
parent 553fe3742f811ed5f1ccd273299613ff9c376985
Author: Florian Dold <florian.dold@gmail.com>
Date: Wed, 12 Aug 2020 00:46:28 +0530
Revert "implement refund gone response when claim token is present on paid order"
This reverts commit 61f5a1fb6baf24ba1c84e00f52e67a266ac3150b.
Diffstat:
1 file changed, 5 insertions(+), 73 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_get-orders-ID.c b/src/backend/taler-merchant-httpd_get-orders-ID.c
@@ -875,54 +875,6 @@ god_cleanup (void *cls)
GNUNET_free (god);
}
-/**
- * Function to call to handle the request by sending
- * back a redirect to the fulfillment URL.
- *
- * @param connection the MHD connection to handle
- * @param url fulfillment URL
- * @return MHD result code
- */
-static MHD_RESULT
-reply_fulfillment_redirect (struct MHD_Connection *connection,
- const char *url)
-{
- const char *text = "Redirecting to fulfillment URL ...";
- struct MHD_Response *response;
-
- response = MHD_create_response_from_buffer (strlen (text),
- (void *) text,
- MHD_RESPMEM_PERSISTENT);
- if (NULL == response)
- {
- GNUNET_break (0);
- return MHD_NO;
- }
- TALER_MHD_add_global_headers (response);
- GNUNET_break (MHD_YES ==
- MHD_add_response_header (response,
- MHD_HTTP_HEADER_CONTENT_TYPE,
- "text/plain"));
- if (MHD_NO ==
- MHD_add_response_header (response,
- MHD_HTTP_HEADER_LOCATION,
- url))
- {
- GNUNET_break (0);
- MHD_destroy_response (response);
- return MHD_NO;
- }
-
- {
- MHD_RESULT ret;
-
- ret = MHD_queue_response (connection,
- MHD_HTTP_FOUND,
- response);
- MHD_destroy_response (response);
- return ret;
- }
-}
/**
* Handle a GET "/orders/$ID" request.
@@ -940,8 +892,6 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
struct GetOrderData *god = hc->ctx;
const char *order_id = hc->infix;
enum GNUNET_DB_QueryStatus qs;
- /* Will we reply with HTTP 410 Gone and just the fulfillment URL? */
- bool reply_gone = false;
if (NULL == god)
{
@@ -1099,16 +1049,11 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
GNUNET_memcmp (&h,
&god->h_contract_terms))
{
- if (0 == GNUNET_is_zero (&god->claim_token))
- {
- /* The client did not provide any claim token, just a wrong h_contract */
- GNUNET_break_op (0);
- return TALER_MHD_reply_with_error (connection,
- MHD_HTTP_FORBIDDEN,
- TALER_EC_GET_ORDER_WRONG_CONTRACT,
- "Contract hash does not match order");
- }
- reply_gone = true;
+ GNUNET_break_op (0);
+ return TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_FORBIDDEN,
+ TALER_EC_GET_ORDER_WRONG_CONTRACT,
+ "Contract hash does not match order");
}
}
@@ -1186,19 +1131,6 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
NULL);
}
- if (reply_gone)
- {
- GNUNET_assert (NULL != god->fulfillment_url);
- if (god->generate_html)
- return reply_fulfillment_redirect (connection,
- god->fulfillment_url);
- else
- return TALER_MHD_reply_json_pack (connection,
- MHD_HTTP_GONE,
- "fulfillment_url",
- god->fulfillment_url);
- }
-
if ( (NULL != god->session_id) &&
(NULL != god->fulfillment_url) )
{