summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-10-13 12:32:09 +0200
committerChristian Grothoff <christian@grothoff.org>2020-10-13 12:32:17 +0200
commit60092876f45ad3b0657adab1e07eb3364c5b4709 (patch)
tree4b62349d90859ce73f72b379eb331f09f37737e9 /src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c
parentd1642d0fd0937d87a56914263361dc5985da0247 (diff)
downloadmerchant-60092876f45ad3b0657adab1e07eb3364c5b4709.tar.gz
merchant-60092876f45ad3b0657adab1e07eb3364c5b4709.tar.bz2
merchant-60092876f45ad3b0657adab1e07eb3364c5b4709.zip
generate refund URI with http/https status based on the merchant_base_url instead of trusting the client to use the same protocol for the request (which can be wrong if the browser decides to prefer https over http)
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.c21
1 files changed, 11 insertions, 10 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 06845bb8..59b82752 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
@@ -121,7 +121,7 @@ TMH_private_post_orders_ID_refund (const struct TMH_RequestHandler *rh,
uint64_t order_serial;
struct GNUNET_TIME_Absolute refund_deadline;
struct GNUNET_TIME_Absolute timestamp;
-
+
qs = TMH_db->lookup_contract_terms (TMH_db->cls,
hc->instance->settings.id,
hc->infix,
@@ -130,11 +130,11 @@ TMH_private_post_orders_ID_refund (const struct TMH_RequestHandler *rh,
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qs)
{
struct GNUNET_JSON_Specification spec[] = {
- TALER_JSON_spec_absolute_time ("refund_deadline",
- &refund_deadline),
- TALER_JSON_spec_absolute_time ("timestamp",
- &timestamp),
- GNUNET_JSON_spec_end ()
+ TALER_JSON_spec_absolute_time ("refund_deadline",
+ &refund_deadline),
+ TALER_JSON_spec_absolute_time ("timestamp",
+ &timestamp),
+ GNUNET_JSON_spec_end ()
};
if (GNUNET_YES !=
@@ -163,7 +163,8 @@ TMH_private_post_orders_ID_refund (const struct TMH_RequestHandler *rh,
#endif
NULL);
}
- if (0 == GNUNET_TIME_absolute_get_remaining (refund_deadline).rel_value_us)
+ if (0 == GNUNET_TIME_absolute_get_remaining (
+ refund_deadline).rel_value_us)
{
/* it is too late for refunds */
/* NOTE: We MAY still be lucky that the exchange did not yet
@@ -178,7 +179,7 @@ TMH_private_post_orders_ID_refund (const struct TMH_RequestHandler *rh,
hc->infix);
}
}
-
+
{
enum GNUNET_GenericReturnValue res;
@@ -251,9 +252,9 @@ TMH_private_post_orders_ID_refund (const struct TMH_RequestHandler *rh,
NULL);
case TALER_MERCHANTDB_RS_NO_SUCH_ORDER:
{
- /* We know the order exists from the
+ /* We know the order exists from the
"lookup_contract_terms" at the beginning;
- so if we get 'no such order' here, it
+ so if we get 'no such order' here, it
must be read as "no PAID order" */
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_CONFLICT,