diff options
Diffstat (limited to 'src/testing/testing_api_cmd_post_using_templates.c')
-rw-r--r-- | src/testing/testing_api_cmd_post_using_templates.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/src/testing/testing_api_cmd_post_using_templates.c b/src/testing/testing_api_cmd_post_using_templates.c index 38743281..28eab0eb 100644 --- a/src/testing/testing_api_cmd_post_using_templates.c +++ b/src/testing/testing_api_cmd_post_using_templates.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2022 Taler Systems SA + Copyright (C) 2022-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 @@ -155,43 +155,41 @@ struct PostUsingTemplatesState * 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 using_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 PostUsingTemplatesState *tis = 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), + &tis->merchant_pub), GNUNET_JSON_spec_end () }; tis->och = NULL; - if (tis->http_status != hr->http_status) + if (tis->http_status != ocr->hr.http_status) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Expected status %u, got %u\n", tis->http_status, - hr->http_status); + ocr->hr.http_status); TALER_TESTING_FAIL (tis->is); } - - tis->contract_terms = json_deep_copy (contract_terms); - tis->h_contract_terms = *hash; - tis->merchant_sig = *sig; + if (MHD_HTTP_OK != ocr->hr.http_status) + { + TALER_TESTING_interpreter_next (tis->is); + return; + } + tis->contract_terms = json_deep_copy ( + (json_t *) ocr->details.ok.contract_terms); + tis->h_contract_terms = ocr->details.ok.h_contract_terms; + tis->merchant_sig = ocr->details.ok.sig; if (GNUNET_OK != - GNUNET_JSON_parse (contract_terms, + GNUNET_JSON_parse (tis->contract_terms, spec, &error_name, &error_line)) @@ -210,7 +208,6 @@ using_claim_cb (void *cls, free (log); TALER_TESTING_FAIL (tis->is); } - tis->merchant_pub = merchant_pub; TALER_TESTING_interpreter_next (tis->is); } |