[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-mdb] branch master updated: show transient message when dis
From: |
gnunet |
Subject: |
[taler-taler-mdb] branch master updated: show transient message when dispensing |
Date: |
Mon, 05 Feb 2024 17:48:20 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository taler-mdb.
The following commit(s) were added to refs/heads/master by this push:
new fab216b show transient message when dispensing
new 21e7fa8 Merge branch 'master' of git+ssh://git.taler.net/taler-mdb
fab216b is described below
commit fab216bf576b574a06fb89ff23c5a5db18207ce4
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Mon Feb 5 17:48:11 2024 +0100
show transient message when dispensing
---
src/taler-mdb.c | 58 ++++++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 41 insertions(+), 17 deletions(-)
diff --git a/src/taler-mdb.c b/src/taler-mdb.c
index 09a5b10..eeea040 100644
--- a/src/taler-mdb.c
+++ b/src/taler-mdb.c
@@ -683,6 +683,11 @@ static char *fulfillment_msg;
*/
static char *essid;
+/**
+ * Should we hide a transient error when MDB is ready?
+ */
+static bool clear_error_on_start;
+
/**
* Handle for the payment
*/
@@ -1222,6 +1227,31 @@ order_delete_cb (
}
+/**
+ * Clear the screen showing the QR code for the order.
+ *
+ * @param[in,out] pa payment activity to clear screen for
+ */
+static void
+clear_screen (struct PaymentActivity *pa)
+{
+ if (NULL == pa->taler_pay_uri)
+ return;
+#if HAVE_QRENCODE_H
+ if (NULL != qrDisplay.memory)
+ memset (qrDisplay.memory,
+ 0xFF,
+ qrDisplay.var_info.xres * qrDisplay.var_info.yres
+ * sizeof (uint16_t));
+ if (0 < qrDisplay.backlightfd)
+ (void) ! write (qrDisplay.backlightfd,
+ &backlight_off,
+ 1);
+#endif
+ GNUNET_free (pa->taler_pay_uri);
+}
+
+
static void
cleanup_payment (struct PaymentActivity *pa)
{
@@ -1288,21 +1318,7 @@ cleanup_payment (struct PaymentActivity *pa)
GNUNET_SCHEDULER_cancel (pa->delay_pay_task);
pa->delay_pay_task = NULL;
}
- if (NULL != pa->taler_pay_uri)
- {
-#if HAVE_QRENCODE_H
- if (NULL != qrDisplay.memory)
- memset (qrDisplay.memory,
- 0xFF,
- qrDisplay.var_info.xres * qrDisplay.var_info.yres
- * sizeof (uint16_t));
- if (0 < qrDisplay.backlightfd)
- (void) ! write (qrDisplay.backlightfd,
- &backlight_off,
- 1);
-#endif
- GNUNET_free (pa->taler_pay_uri);
- }
+ clear_screen (pa);
GNUNET_free (pa->order_id);
GNUNET_SCHEDULER_add_now (&async_pa_cleanup_job,
pa);
@@ -1744,7 +1760,7 @@ check_payment_cb (void *cls,
(MHD_HTTP_REQUEST_TIMEOUT != hr->http_status) )
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Backend request to /check-payment failed: %u/%d\n",
+ "Backend request to GET /orders/$ID failed: %u/%d\n",
hr->http_status,
(int) hr->ec);
mdb.cmd = &cmd_reader_display_backend_not_reachable;
@@ -1757,11 +1773,14 @@ check_payment_cb (void *cls,
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Backend request to /check-payment returned: %u\n",
+ "Backend request to GET /orders/$ID returned: %u\n",
hr->http_status);
if ( (MHD_HTTP_OK == hr->http_status) &&
(TALER_MERCHANT_OSC_PAID == osr->details.ok.status) )
{
+ clear_screen (pa);
+ clear_error_on_start = true;
+ temporary_error ("dispensing");
mdb.cmd = &cmd_approve_vend;
payment_activity->paid = true;
run_mdb_event_loop ();
@@ -2043,6 +2062,11 @@ vend_success (void)
cleanup_payment (payment_activity);
payment_activity = NULL;
}
+ if (clear_error_on_start)
+ {
+ hide_error ();
+ start_advertising ();
+ }
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-taler-mdb] branch master updated: show transient message when dispensing,
gnunet <=