diff options
Diffstat (limited to 'src/lib/merchant_api_tip_pickup.c')
-rw-r--r-- | src/lib/merchant_api_tip_pickup.c | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/src/lib/merchant_api_tip_pickup.c b/src/lib/merchant_api_tip_pickup.c index 75ec2d6c..cd1f2035 100644 --- a/src/lib/merchant_api_tip_pickup.c +++ b/src/lib/merchant_api_tip_pickup.c @@ -159,23 +159,19 @@ fail_pickup (struct TALER_MERCHANT_TipPickupHandle *tp, * Note that the client MUST still do the unblinding of the @a blind_sigs. * * @param cls closure, a `struct TALER_MERCHANT_TipPickupHandle *` - * @param hr HTTP response details - * @param num_blind_sigs length of the @a reserve_sigs array, 0 on error - * @param blind_sigs array of blind signatures over the planchets, NULL on error + * @param tpr response details */ static void pickup_done_cb (void *cls, - const struct TALER_MERCHANT_HttpResponse *hr, - unsigned int num_blind_sigs, - const struct TALER_BlindedDenominationSignature *blind_sigs) + const struct TALER_MERCHANT_TipPickup2Response *tpr) { struct TALER_MERCHANT_TipPickupHandle *tp = cls; struct TALER_MERCHANT_PickupDetails pd = { - .hr = *hr + .hr = tpr->hr }; tp->tpo2 = NULL; - if (NULL == blind_sigs) + if (MHD_HTTP_OK != tpr->hr.http_status) { tp->cb (tp->cb_cls, &pd); @@ -185,14 +181,17 @@ pickup_done_cb (void *cls, { enum GNUNET_GenericReturnValue ok = GNUNET_OK; - for (unsigned int i = 0; i<num_blind_sigs; i++) + for (unsigned int i = 0; i<tpr->details.ok.num_blind_sigs; i++) { - struct TALER_EXCHANGE_PrivateCoinDetails *pcd = &tp->pcds[i]; + const struct TALER_BlindedDenominationSignature *blind_sig + = &tpr->details.ok.blind_sigs[i]; + struct TALER_EXCHANGE_PrivateCoinDetails *pcd + = &tp->pcds[i]; struct TALER_FreshCoin fc; if (GNUNET_OK != TALER_planchet_to_coin (&tp->planchets[i].pk.key, - &blind_sigs[i], + blind_sig, &pcd->bks, &pcd->coin_priv, NULL, @@ -207,22 +206,15 @@ pickup_done_cb (void *cls, } if (GNUNET_OK != ok) { - struct TALER_MERCHANT_HttpResponse hrx = { - .reply = hr->reply, - .ec = TALER_EC_MERCHANT_TIP_PICKUP_UNBLIND_FAILURE - }; - - pd.hr = hrx; - tp->cb (tp->cb_cls, - &pd); + pd.hr.ec = TALER_EC_MERCHANT_TIP_PICKUP_UNBLIND_FAILURE; } else { - pd.details.ok.num_sigs = num_blind_sigs; + pd.details.ok.num_sigs = tpr->details.ok.num_blind_sigs; pd.details.ok.pcds = tp->pcds; - tp->cb (tp->cb_cls, - &pd); } + tp->cb (tp->cb_cls, + &pd); } TALER_MERCHANT_tip_pickup_cancel (tp); } |