summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_private-get-orders-ID.c
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-09-07 15:38:34 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-09-07 15:38:45 +0530
commitf6b5dd04e06198a023eb38945c963a9128065786 (patch)
treeed176ee1068c9fb1ef164218bcc2c541c79e678f /src/backend/taler-merchant-httpd_private-get-orders-ID.c
parent39067e234d2e11eac5d0ac5fdb6f88c79dc62276 (diff)
downloadmerchant-f6b5dd04e06198a023eb38945c963a9128065786.tar.gz
merchant-f6b5dd04e06198a023eb38945c963a9128065786.tar.bz2
merchant-f6b5dd04e06198a023eb38945c963a9128065786.zip
append h_contract when appropriate
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-get-orders-ID.c')
-rw-r--r--src/backend/taler-merchant-httpd_private-get-orders-ID.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/src/backend/taler-merchant-httpd_private-get-orders-ID.c b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
index 550b9df2..a57845d4 100644
--- a/src/backend/taler-merchant-httpd_private-get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
@@ -978,7 +978,8 @@ TMH_private_get_orders_ID (const struct TMH_RequestHandler *rh,
hc->infix,
gorc->session_id,
hc->instance->settings.id,
- &claim_token);
+ &claim_token,
+ NULL);
ret = TALER_MHD_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:s, s:s, s:s, s:s, s:s?}",
@@ -1056,7 +1057,8 @@ TMH_private_get_orders_ID (const struct TMH_RequestHandler *rh,
hc->infix,
gorc->session_id,
hc->instance->settings.id,
- &claim_token);
+ &claim_token,
+ NULL);
ret = TALER_MHD_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:s, s:s, s:s}",
@@ -1184,11 +1186,26 @@ TMH_private_get_orders_ID (const struct TMH_RequestHandler *rh,
}
}
- order_status_url = TMH_make_order_status_url (connection,
- hc->infix,
- gorc->session_id,
- hc->instance->settings.id,
- &claim_token);
+ {
+ struct GNUNET_HashCode *h_contract = NULL;
+
+ /* In a session-bound payment, allow the browser to check the order
+ * status page (e.g. to get a refund).
+ *
+ * Note that we don't allow this outside of session-based payment, as
+ * otherwise this becomes an oracle to convert order_id to h_contract.
+ */
+ if (NULL != gorc->session_id)
+ h_contract = &gorc->h_contract_terms;
+
+ order_status_url =
+ TMH_make_order_status_url (connection,
+ hc->infix,
+ gorc->session_id,
+ hc->instance->settings.id,
+ &claim_token,
+ h_contract);
+ }
ret = TALER_MHD_reply_json_pack (connection,
MHD_HTTP_OK,