diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-07-14 21:06:10 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-07-14 21:06:10 +0200 |
commit | f42290533eb6c686cac8e0ca4041be5380ab1ea0 (patch) | |
tree | ffcc07d7f157f93fbaacbe391a2a3da86020b7e3 /src/taler-coin-acceptor.c | |
parent | 66190e93d40e84050003c6c34c454ece73b6e12a (diff) | |
download | taler-mdb-f42290533eb6c686cac8e0ca4041be5380ab1ea0.tar.gz taler-mdb-f42290533eb6c686cac8e0ca4041be5380ab1ea0.tar.bz2 taler-mdb-f42290533eb6c686cac8e0ca4041be5380ab1ea0.zip |
clear display on first QR code, update to latest merchant APIv0.9.3
Diffstat (limited to 'src/taler-coin-acceptor.c')
-rw-r--r-- | src/taler-coin-acceptor.c | 82 |
1 files changed, 41 insertions, 41 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, |