taler-mdb

GNU Taler Extensions and Integrations
Log | Files | Refs | Submodules | README | LICENSE

commit ab91096f041ef69572c995f242b68ef78400b923
parent 8f60d0f980ff212e3bb43736bde2f3e365615589
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed,  4 Dec 2019 13:35:33 +0100

add 'a' command

Diffstat:
Msrc/main.c | 21++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c @@ -1177,6 +1177,23 @@ read_keyboard_command (void *cls) start_read_keyboard (); return; } + if ((char) input == 'a') + { + if (NULL != payment_activity) + { + mdb.cmd = &approveVend; + run_mdb_event_loop (); + cleanup_payment (payment_activity); + payment_activity = NULL; + } + else + { + fprintf (stderr, + "No purchase activity pending\n"); + } + start_read_keyboard (); + return; + } if (NULL != payment_activity) { fprintf (stderr, @@ -1211,7 +1228,9 @@ start_read_keyboard () printf ("'%c' to buy %s\n", products[i].key, products[i].description); - printf ("'c' to cancel last purchase\n'x' to quit\n"); + printf ("'a' to fake payment for the last purchase\n" + "'c' to cancel last purchase\n" + "'x' to quit\n"); printf ("Waiting for keyboard input\n"); keyboard_task = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, &fh,