diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-08-22 19:20:51 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-08-22 19:20:51 +0200 |
commit | 97b02a22a9904c42d26e7973a82b9751e60f2135 (patch) | |
tree | c3f1ae5d40a01529bb0dac421f1465409828014b /src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c | |
parent | 13e71102938d16ff4777501532b3f8d1f574ad62 (diff) | |
download | merchant-97b02a22a9904c42d26e7973a82b9751e60f2135.tar.gz merchant-97b02a22a9904c42d26e7973a82b9751e60f2135.tar.bz2 merchant-97b02a22a9904c42d26e7973a82b9751e60f2135.zip |
pass h_contract separate from URI, that is cleaner
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c b/src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c index b5ef07bd..d308bf4b 100644 --- a/src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c +++ b/src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c @@ -40,14 +40,12 @@ * @param connection MHD connection to take host and path from * @param instance_id merchant's instance ID, must not be NULL * @param order_id order ID to show a refund for, must not be NULL - * @param h_contract hash of the contract to pass for authorization * @returns the URI, must be freed with #GNUNET_free */ static char * make_taler_refund_uri (struct MHD_Connection *connection, const char *instance_id, - const char *order_id, - const struct GNUNET_HashCode *h_contract) + const char *order_id) { const char *host; const char *forwarded_host; @@ -89,11 +87,6 @@ make_taler_refund_uri (struct MHD_Connection *connection, GNUNET_buffer_write_path (&buf, order_id); GNUNET_buffer_write_path (&buf, ""); // Trailing slash - GNUNET_buffer_write_str (&buf, - "?h_contract="); - GNUNET_buffer_write_data_encoded (&buf, - &h_contract, - sizeof (*h_contract)); return GNUNET_buffer_reap_str (&buf); } @@ -294,13 +287,14 @@ TMH_private_post_orders_ID_refund (const struct TMH_RequestHandler *rh, taler_refund_uri = make_taler_refund_uri (connection, hc->instance->settings.id, - hc->infix, - &h_contract); + hc->infix); ret = TALER_MHD_reply_json_pack (connection, MHD_HTTP_OK, - "{s:s}", + "{s:s, s:o}", "taler_refund_uri", - taler_refund_uri); + taler_refund_uri, + "h_contract", + GNUNET_JSON_from_data_auto (&h_contract)); GNUNET_free (taler_refund_uri); return ret; } |