merchant

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

commit 93063ba17a2e3d0d897635e7d92aa21fba06ec33
parent bf9076aa6dc591e24c2890cc3fd07ffb6c00445b
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Wed,  9 May 2018 11:22:21 +0200

proposal CMD generates order_id if missing.

Diffstat:
Msrc/lib/testing_api_cmd_proposal.c | 19+++++++++++++++++++
Msrc/merchant-tools/taler-merchant-generate-payments_new.c | 9++++-----
2 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/src/lib/testing_api_cmd_proposal.c b/src/lib/testing_api_cmd_proposal.c @@ -346,6 +346,25 @@ proposal_run (void *cls, return; } + if (NULL == json_object_get (order, + "order_id")) + { + struct GNUNET_TIME_Absolute now; + char *order_id; + + now = GNUNET_TIME_absolute_get (); + + order_id = GNUNET_STRINGS_data_to_string_alloc + (&now.abs_value_us, + sizeof (now.abs_value_us)); + + json_object_set (order, + "order_id", + json_string (order_id)); + + GNUNET_free (order_id); + } + GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, &ps->nonce, diff --git a/src/merchant-tools/taler-merchant-generate-payments_new.c b/src/merchant-tools/taler-merchant-generate-payments_new.c @@ -83,6 +83,7 @@ static char *logfile; */ static char *merchant_url; + /** * Actual commands collection. */ @@ -90,11 +91,9 @@ static void run (void *cls, struct TALER_TESTING_Interpreter *is) { - struct TALER_TESTING_Command commands[] = { - TALER_TESTING_cmd_end () - }; + /* Looping will be implemented by rewinding the instruction + pointer. */ - TALER_TESTING_run (is, commands); } /** @@ -181,7 +180,7 @@ main (int argc, argv)); GNUNET_log_setup ("taler-merchant-generate-payments-new", - "INFO", + "DEBUG", logfile); if (NULL == merchant_url)