commit 1344b9e81168da174412b408694978884a101954
parent ab73d7c08c677f449f2a3710934166683a4cfa12
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 10 Nov 2019 22:59:07 +0100
preparations for QR code alternative path
Diffstat:
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/main.c b/src/main.c
@@ -482,12 +482,17 @@ check_payment_cb (void *cls,
{
fprintf (stderr,
"FIXME: yield product here!\n");
+ /* FIXME: hide QR code here! */
}
else
{
- if (GNUNET_YES == pa->wallet_has_uri)
+ /* Start to check for payment. Note that we do this even before
+ we talked successfully to the wallet via NFC because we MAY show the
+ QR code in the future and in that case the payment may happen
+ anytime even before the NFC communication succeeds. */
+ if ( (NULL == pa->cpo) &&
+ (NULL == pa->delay_task) )
{
- GNUNET_assert (NULL == pa->delay_task);
pa->delay_task = GNUNET_SCHEDULER_add_delayed (MAX_HTTP_RETRY_FREQ,
&check_payment_again,
pa);
@@ -495,7 +500,11 @@ check_payment_cb (void *cls,
}
if (NULL == pa->taler_pay_uri)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Trying to talk to wallet to give it pay URI `%s'\n",
+ taler_pay_uri);
GNUNET_assert (NULL == pa->pnd);
+ /* FIXME: show QR code here! */
pa->taler_pay_uri = GNUNET_strdup (taler_pay_uri);
pa->task = GNUNET_SCHEDULER_add_now (&connect_nfc,
pa);