[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-mdb] branch master updated: clear display on first QR code,
From: |
gnunet |
Subject: |
[taler-taler-mdb] branch master updated: clear display on first QR code, update to latest merchant API |
Date: |
Fri, 14 Jul 2023 21:06:14 +0200 |
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 f422905 clear display on first QR code, update to latest merchant API
f422905 is described below
commit f42290533eb6c686cac8e0ca4041be5380ab1ea0
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Jul 14 21:06:10 2023 +0200
clear display on first QR code, update to latest merchant API
---
src/taler-coin-acceptor.c | 82 +++++++++++++++++++++++------------------------
src/taler-mdb.c | 7 +++-
2 files changed, 47 insertions(+), 42 deletions(-)
diff --git a/src/taler-coin-acceptor.c b/src/taler-coin-acceptor.c
index df3d5ae..ca5b71f 100644
--- a/src/taler-coin-acceptor.c
+++ b/src/taler-coin-acceptor.c
@@ -83,14 +83,14 @@ static struct GNUNET_CURL_Context *ctx;
static struct GNUNET_CURL_RescheduleContext *rc;
/**
- * Handle used to issue the tip.
+ * Handle used to issue the reward.
*/
-static struct TALER_MERCHANT_TipAuthorizeHandle *tah;
+static struct TALER_MERCHANT_RewardAuthorizeHandle *tah;
/**
- * Handle to watch for tip being picked up.
+ * Handle to watch for reward being picked up.
*/
-static struct TALER_MERCHANT_TipMerchantGetHandle *tmgh;
+static struct TALER_MERCHANT_RewardMerchantGetHandle *tmgh;
/**
* Current sum.
@@ -98,9 +98,9 @@ static struct TALER_MERCHANT_TipMerchantGetHandle *tmgh;
static struct TALER_Amount sum;
/**
- * Tip ID of the currently active tip.
+ * Reward ID of the currently active reward.
*/
-static struct TALER_TipIdentifierP tip_id;
+static struct TALER_RewardIdentifierP reward_id;
/**
* Function run on shutdown.
@@ -141,12 +141,12 @@ do_shutdown (void *cls)
}
if (NULL != tah)
{
- TALER_MERCHANT_tip_authorize_cancel (tah);
+ TALER_MERCHANT_reward_authorize_cancel (tah);
tah = NULL;
}
if (NULL != tmgh)
{
- TALER_MERCHANT_merchant_tip_get_cancel (tmgh);
+ TALER_MERCHANT_merchant_reward_get_cancel (tmgh);
tmgh = NULL;
}
if (GNUNET_OK ==
@@ -163,7 +163,7 @@ do_shutdown (void *cls)
/**
- * With result of a GET /private/tips/$TIP_ID request
+ * With result of a GET /private/rewards/$REWARD_ID request
*
* @param cls closure
* @param tsr response details
@@ -171,7 +171,7 @@ do_shutdown (void *cls)
static void
pickup_cb (
void *cls,
- const struct TALER_MERCHANT_TipStatusResponse *tsr)
+ const struct TALER_MERCHANT_RewardStatusResponse *tsr)
{
tmgh = NULL;
switch (tsr->hr.http_status)
@@ -189,14 +189,14 @@ pickup_cb (
return;
}
/* Keep checking */
- tmgh = TALER_MERCHANT_merchant_tip_get (ctx,
- merchant_url,
- &tip_id,
- NULL,
- GNUNET_TIME_UNIT_ZERO,
- false,
- &pickup_cb,
- NULL);
+ tmgh = TALER_MERCHANT_merchant_reward_get (ctx,
+ merchant_url,
+ &reward_id,
+ NULL,
+ GNUNET_TIME_UNIT_ZERO,
+ false,
+ &pickup_cb,
+ NULL);
GNUNET_assert (NULL != tmgh);
return;
default:
@@ -206,7 +206,7 @@ pickup_cb (
/**
- * Callback for a /reserves/$RESERVE_PUB/tip-authorize request. Returns the
result of
+ * Callback for a /reserves/$RESERVE_PUB/reward-authorize request. Returns
the result of
* the operation.
*
* @param cls closure, NULL
@@ -215,7 +215,7 @@ pickup_cb (
static void
authorize_cb (
void *cls,
- const struct TALER_MERCHANT_TipAuthorizeResponse *tar)
+ const struct TALER_MERCHANT_RewardAuthorizeResponse *tar)
{
const struct TALER_MERCHANT_HttpResponse *hr = &tar->hr;
@@ -230,20 +230,20 @@ authorize_cb (
return;
}
- // FIXME: show tip_uri on display!
+ // FIXME: show reward_uri on display!
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Tip pickup uri: %s\n",
- tar->details.ok.tip_uri);
+ "Reward pickup uri: %s\n",
+ tar->details.ok.reward_uri);
/* FIXME: merchant service to support long-polling here! */
- tip_id = tar->details.ok.tip_id;
- tmgh = TALER_MERCHANT_merchant_tip_get (ctx,
- merchant_url,
- &tar->details.ok.tip_id,
- NULL,
- GNUNET_TIME_UNIT_ZERO,
- false,
- &pickup_cb,
- NULL);
+ reward_id = tar->details.ok.reward_id;
+ tmgh = TALER_MERCHANT_merchant_reward_get (ctx,
+ merchant_url,
+ &tar->details.ok.reward_id,
+ NULL,
+ GNUNET_TIME_UNIT_ZERO,
+ false,
+ &pickup_cb,
+ NULL);
GNUNET_assert (NULL != tmgh);
}
@@ -292,18 +292,18 @@ do_read (void *cls)
value));
if (NULL != tah)
{
- TALER_MERCHANT_tip_authorize_cancel (tah);
+ TALER_MERCHANT_reward_authorize_cancel (tah);
tah = NULL;
}
/* FIXME: handle case where we INCREASE an
- existing tip! (needs new backend API!) */
- tah = TALER_MERCHANT_tip_authorize (ctx,
- merchant_url,
- "taler://FIXME",
- &sum,
- "coin acceptor",
- &authorize_cb,
- NULL);
+ existing reward! (needs new backend API!) */
+ tah = TALER_MERCHANT_reward_authorize (ctx,
+ merchant_url,
+ "taler://FIXME",
+ &sum,
+ "coin acceptor",
+ &authorize_cb,
+ NULL);
}
}
tt = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
diff --git a/src/taler-mdb.c b/src/taler-mdb.c
index 379363f..f66d252 100644
--- a/src/taler-mdb.c
+++ b/src/taler-mdb.c
@@ -895,6 +895,10 @@ show_qrcode (const char *uri)
}
/* set QR-code border */
+ memset (qrDisplay.memory,
+ 0xFF,
+ qrDisplay.var_info.xres * qrDisplay.var_info.yres
+ * sizeof (uint16_t));
size = GNUNET_MIN (qrDisplay.var_info.xres,
qrDisplay.var_info.yres);
unsigned int nwidth = qrc->width + 8; /* +8 for 4 pixel border */
@@ -1653,6 +1657,7 @@ start_read_cancel_button (void);
static struct PaymentActivity *
launch_payment (struct Product *product)
{
+ static const char *uuids[1];
struct PaymentActivity *pa;
json_t *orderReq;
char *msg;
@@ -1767,7 +1772,7 @@ launch_payment (struct Product *product)
0,
NULL, /* no inventory */
0,
- NULL, /* no locks */
+ uuids, /* no locks */
false, /* no claim token */
&proposal_cb,
pa);
--
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: clear display on first QR code, update to latest merchant API,
gnunet <=