merchant

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

commit 8476ecfc8b80295e6ed82e9a43a4ca3894ab499c
parent f6aca4dce222986bfcbdcecac3aa04229eb870a9
Author: Florian Dold <florian.dold@gmail.com>
Date:   Sun, 12 Feb 2017 18:17:37 +0100

set pay deadline if not in frontent order

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

diff --git a/src/backend/taler-merchant-httpd_proposal.c b/src/backend/taler-merchant-httpd_proposal.c @@ -190,6 +190,15 @@ proposal_put (struct MHD_Connection *connection, json_t *order) json_object_set (order, "refund_deadline", GNUNET_JSON_from_time_abs (zero)); } + if (NULL == json_string_value (json_object_get (order, "pay_deadline"))) + { + struct GNUNET_TIME_Absolute t; + /* FIXME: read the delay for pay_deadline from config */ + t = GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (), GNUNET_TIME_UNIT_HOURS); + (void) GNUNET_TIME_round_abs (&t); + json_object_set (order, "pay_deadline", GNUNET_JSON_from_time_abs (t)); + } + /* extract fields we need to sign separately */ res = TMH_PARSE_json_data (connection, order, spec); if (GNUNET_NO == res)