diff options
Diffstat (limited to 'src/testing/testing_api_cmd_abort_order.c')
-rw-r--r-- | src/testing/testing_api_cmd_abort_order.c | 53 |
1 files changed, 23 insertions, 30 deletions
diff --git a/src/testing/testing_api_cmd_abort_order.c b/src/testing/testing_api_cmd_abort_order.c index b9f7682b..1e6da35c 100644 --- a/src/testing/testing_api_cmd_abort_order.c +++ b/src/testing/testing_api_cmd_abort_order.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014-2018, 2020 Taler Systems SA + Copyright (C) 2014-2023 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -116,7 +116,6 @@ build_coins (struct TALER_MERCHANT_AbortCoin **ac, } { const struct TALER_TESTING_Command *coin_cmd; - const char **exchange_url; coin_cmd = TALER_TESTING_interpreter_lookup_command (is, token); @@ -142,8 +141,7 @@ build_coins (struct TALER_MERCHANT_AbortCoin **ac, } GNUNET_assert (GNUNET_OK == TALER_TESTING_get_trait_exchange_url (coin_cmd, - &exchange_url)); - icoin->exchange_url = *exchange_url; + &icoin->exchange_url)); { const struct TALER_Amount *denom_value; @@ -165,48 +163,42 @@ build_coins (struct TALER_MERCHANT_AbortCoin **ac, * in the state. * * @param cls closure. - * @param hr HTTP response - * @param merchant_pub public key of the merchant refunding the - * contract. - * @param num_aborts length of the @a res array - * @param res array containing the abort confirmations + * @param ar response */ static void abort_cb (void *cls, - const struct TALER_MERCHANT_HttpResponse *hr, - const struct TALER_MerchantPublicKeyP *merchant_pub, - unsigned int num_aborts, - const struct TALER_MERCHANT_AbortedCoin res[]) + const struct TALER_MERCHANT_AbortResponse *ar) { struct AbortState *as = cls; as->oah = NULL; - if (as->http_status != hr->http_status) + if (as->http_status != ar->hr.http_status) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unexpected response code %u (%d) to command `%s' (expected %u)\n", - hr->http_status, - (int) hr->ec, + ar->hr.http_status, + (int) ar->hr.ec, TALER_TESTING_interpreter_get_current_label (as->is), as->http_status); TALER_TESTING_FAIL (as->is); } - if ( (MHD_HTTP_OK == hr->http_status) && - (TALER_EC_NONE == hr->ec) ) + if ( (MHD_HTTP_OK == ar->hr.http_status) && + (TALER_EC_NONE == ar->hr.ec) ) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received %u refunds\n", - num_aborts); - as->acs_length = num_aborts; - as->acs = GNUNET_new_array (num_aborts, + ar->details.ok.num_aborts); + as->acs_length = ar->details.ok.num_aborts; + as->acs = GNUNET_new_array (as->acs_length, struct TALER_MERCHANT_AbortedCoin); - memcpy (as->acs, - res, - num_aborts * sizeof (struct TALER_MERCHANT_AbortedCoin)); + GNUNET_memcpy (as->acs, + ar->details.ok.aborts, + as->acs_length + * sizeof (struct TALER_MERCHANT_AbortedCoin)); } GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successful pay-abort (HTTP status: %u)\n", - hr->http_status); + ar->hr.http_status); TALER_TESTING_interpreter_next (as->is); } @@ -225,8 +217,8 @@ abort_run (void *cls, { struct AbortState *as = cls; const struct TALER_TESTING_Command *pay_cmd; - const char **proposal_reference; - const char **coin_reference; + const char *proposal_reference; + const char *coin_reference; const struct TALER_TESTING_Command *proposal_cmd; const char *order_id; const struct TALER_PrivateContractHashP *h_proposal; @@ -253,7 +245,7 @@ abort_run (void *cls, &coin_reference)) TALER_TESTING_FAIL (is); proposal_cmd = TALER_TESTING_interpreter_lookup_command (is, - *proposal_reference); + proposal_reference); if (NULL == proposal_cmd) TALER_TESTING_FAIL (is); @@ -299,7 +291,7 @@ abort_run (void *cls, } } - cr = GNUNET_strdup (*coin_reference); + cr = GNUNET_strdup (coin_reference); abort_coins = NULL; nabort_coins = 0; if (GNUNET_OK != @@ -320,7 +312,8 @@ abort_run (void *cls, TALER_TESTING_get_trait_h_contract_terms (proposal_cmd, &h_proposal)) TALER_TESTING_FAIL (is); - as->oah = TALER_MERCHANT_order_abort (is->ctx, + as->oah = TALER_MERCHANT_order_abort (TALER_TESTING_interpreter_get_context ( + is), as->merchant_url, order_id, &merchant_pub, |