diff options
Diffstat (limited to 'src/testing/testing_api_cmd_post_orders.c')
-rw-r--r-- | src/testing/testing_api_cmd_post_orders.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/src/testing/testing_api_cmd_post_orders.c b/src/testing/testing_api_cmd_post_orders.c index b818bd8c..4669a8d1 100644 --- a/src/testing/testing_api_cmd_post_orders.c +++ b/src/testing/testing_api_cmd_post_orders.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014-2021 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 @@ -181,43 +181,41 @@ orders_traits (void *cls, * created. * * @param cls closure - * @param hr HTTP response we got - * @param contract_terms contract terms of this order - * @param sig merchant's signature - * @param hash hash over the contract + * @param ocr response we got */ static void orders_claim_cb (void *cls, - const struct TALER_MERCHANT_HttpResponse *hr, - const json_t *contract_terms, - const struct TALER_MerchantSignatureP *sig, - const struct TALER_PrivateContractHashP *hash) + const struct TALER_MERCHANT_OrderClaimResponse *ocr) { struct OrdersState *ps = cls; - struct TALER_MerchantPublicKeyP merchant_pub; const char *error_name; unsigned int error_line; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_fixed_auto ("merchant_pub", - &merchant_pub), + &ps->merchant_pub), GNUNET_JSON_spec_end () }; ps->och = NULL; - if (ps->http_status != hr->http_status) + if (ps->http_status != ocr->hr.http_status) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Expected status %u, got %u\n", ps->http_status, - hr->http_status); + ocr->hr.http_status); TALER_TESTING_FAIL (ps->is); } - - ps->contract_terms = json_deep_copy (contract_terms); - ps->h_contract_terms = *hash; - ps->merchant_sig = *sig; + if (MHD_HTTP_OK != ocr->hr.http_status) + { + TALER_TESTING_interpreter_next (ps->is); + return; + } + ps->contract_terms = json_deep_copy ( + (json_t *) ocr->details.ok.contract_terms); + ps->h_contract_terms = ocr->details.ok.h_contract_terms; + ps->merchant_sig = ocr->details.ok.sig; if (GNUNET_OK != - GNUNET_JSON_parse (contract_terms, + GNUNET_JSON_parse (ps->contract_terms, spec, &error_name, &error_line)) @@ -236,7 +234,6 @@ orders_claim_cb (void *cls, free (log); TALER_TESTING_FAIL (ps->is); } - ps->merchant_pub = merchant_pub; TALER_TESTING_interpreter_next (ps->is); } |