merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit bf7fe7355d52461c9480979682e9c108f20a0822
parent c078ae58ccb190dc340238347b15bf4b9e608ef4
Author: Florian Dold <florian.dold@gmail.com>
Date:   Sun, 12 Feb 2017 18:04:30 +0100

add timestamp if missing

Diffstat:
Msrc/backend/taler-merchant-httpd_proposal.c | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 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)