summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-05 22:05:50 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-05 22:05:50 +0200
commit76243c5398d79d370636d69df7368648e3e14770 (patch)
tree11a2cac2a7613350a36241aed8df12a8e804d820 /src/lib
parent45e65f85429ad4e78d0cb2ba43923468f0429ae5 (diff)
downloadmerchant-76243c5398d79d370636d69df7368648e3e14770.tar.gz
merchant-76243c5398d79d370636d69df7368648e3e14770.tar.bz2
merchant-76243c5398d79d370636d69df7368648e3e14770.zip
update to match latest exchange API
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/testing_api_cmd_pay_abort_refund.c22
-rw-r--r--src/lib/testing_api_cmd_tip_pickup.c33
2 files changed, 17 insertions, 38 deletions
diff --git a/src/lib/testing_api_cmd_pay_abort_refund.c b/src/lib/testing_api_cmd_pay_abort_refund.c
index 42bf00bb..0d811c1c 100644
--- a/src/lib/testing_api_cmd_pay_abort_refund.c
+++ b/src/lib/testing_api_cmd_pay_abort_refund.c
@@ -83,32 +83,24 @@ struct PayAbortRefundState
* code is as expected.
*
* @param cls closure
- * @param http_status HTTP response code, #MHD_HTTP_OK (200) for
- * successful deposit; 0 if the exchange's reply is bogus
- * (fails to follow the protocol)
- * @param ec taler-specific error code, #TALER_EC_NONE on success
+ * @param hr HTTP response code details
* @param sign_key exchange key used to sign @a obj, or NULL
- * @param obj the received JSON reply, should be kept as proof
- * (and, in particular, be forwarded to the customer)
*/
static void
abort_refund_cb (void *cls,
- unsigned int http_status,
- enum TALER_ErrorCode ec,
- const struct TALER_ExchangePublicKeyP *sign_key,
- const json_t *obj)
+ const struct TALER_EXCHANGE_HttpResponse *hr,
+ const struct TALER_ExchangePublicKeyP *sign_key)
{
struct PayAbortRefundState *pars = cls;
pars->rh = NULL;
- if (pars->http_status != http_status)
+ if (pars->http_status != hr->http_status)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Unexpected response code %u (%d) to command %s\n",
- http_status,
- ec,
- TALER_TESTING_interpreter_get_current_label
- (pars->is));
+ hr->http_status,
+ hr->ec,
+ TALER_TESTING_interpreter_get_current_label (pars->is));
TALER_TESTING_interpreter_fail (pars->is);
return;
}
diff --git a/src/lib/testing_api_cmd_tip_pickup.c b/src/lib/testing_api_cmd_tip_pickup.c
index c26b1cfa..fb243af6 100644
--- a/src/lib/testing_api_cmd_tip_pickup.c
+++ b/src/lib/testing_api_cmd_tip_pickup.c
@@ -154,20 +154,13 @@ struct WithdrawHandle
* from the exchange, that is the final step in getting the tip.
*
* @param cls closure, a `struct WithdrawHandle *`
- * @param http_status HTTP response code, #MHD_HTTP_OK (200)
- * for successful status request, 0 if the exchange's
- * reply is bogus (fails to follow the protocol)
- * @param ec taler-specific error code, #TALER_EC_NONE on success
+ * @param hr HTTP response details
* @param sig signature over the coin, NULL on error
- * @param full_response full response from the exchange
- * (for logging, in case of errors)
*/
static void
pickup_withdraw_cb (void *cls,
- unsigned int http_status,
- enum TALER_ErrorCode ec,
- const struct TALER_DenominationSignature *sig,
- const json_t *full_response)
+ const struct TALER_EXCHANGE_HttpResponse *hr,
+ const struct TALER_DenominationSignature *sig)
{
struct WithdrawHandle *wh = cls;
struct TALER_TESTING_Interpreter *is = wh->is;
@@ -178,17 +171,16 @@ pickup_withdraw_cb (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Withdraw operation %u completed with %u (%d)\n",
wh->off,
- http_status,
- ec);
+ hr->http_status,
+ hr->ec);
GNUNET_assert (wh->off < tps->num_coins);
- if ( (MHD_HTTP_OK != http_status) ||
- (TALER_EC_NONE != ec) )
+ if ( (MHD_HTTP_OK != hr->http_status) ||
+ (TALER_EC_NONE != hr->ec) )
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u (%d)"
- " to command %s when withdrawing\n",
- http_status,
- ec,
+ "Unexpected response code %u (%d) to command %s when withdrawing\n",
+ hr->http_status,
+ hr->ec,
TALER_TESTING_interpreter_get_current_label (is));
TALER_TESTING_interpreter_fail (is);
return;
@@ -482,21 +474,16 @@ tip_pickup_traits (void *cls,
{
traits[i] = TALER_TESTING_make_trait_planchet_secrets
(i, &tps->psa[i]);
-
traits[i + tps->num_coins] =
TALER_TESTING_make_trait_coin_priv
(i, &tps->psa[i].coin_priv);
-
traits[i + (tps->num_coins * 2)] =
TALER_TESTING_make_trait_denom_pub (i, tps->dks[i]);
-
traits[i + (tps->num_coins * 3)] =
TALER_TESTING_make_trait_denom_sig (i, &tps->sigs[i]);
-
traits[i + (tps->num_coins * 4)] =
TALER_TESTING_make_trait_amount_obj
(i, &tps->amounts_obj[i]);
-
}
traits[NUM_TRAITS - 2] = TALER_TESTING_make_trait_url
(TALER_TESTING_UT_EXCHANGE_BASE_URL,