diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/taler-merchant-httpd_proposal.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/taler-merchant-httpd_proposal.c b/src/backend/taler-merchant-httpd_proposal.c index ea05a201..86648dbb 100644 --- a/src/backend/taler-merchant-httpd_proposal.c +++ b/src/backend/taler-merchant-httpd_proposal.c @@ -160,8 +160,7 @@ proposal_put (struct MHD_Connection *connection, json_t *order) /* Add order_id if it doesn't exist. */ - order_id = json_string_value (json_object_get (order, "order_id")); - if (NULL == order_id) + if (NULL == json_string_value (json_object_get (order, "order_id"))) { char buf[256]; time_t timer; @@ -178,6 +177,11 @@ proposal_put (struct MHD_Connection *connection, json_t *order) json_object_set (order, "order_id", json_string (buf)); } + if (NULL == json_string_value (json_object_get (order, "timestamp"))) + { + json_object_set (order, "timestamp", GNUNET_JSON_from_time_abs (GNUNET_TIME_absolute_get ())); + } + /* extract fields we need to sign separately */ res = TMH_PARSE_json_data (connection, order, spec); if (GNUNET_NO == res) |