diff options
Diffstat (limited to 'src/testing/testing_api_cmd_claim_order.c')
-rw-r--r-- | src/testing/testing_api_cmd_claim_order.c | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/src/testing/testing_api_cmd_claim_order.c b/src/testing/testing_api_cmd_claim_order.c index d7a3ec41..aec03876 100644 --- a/src/testing/testing_api_cmd_claim_order.c +++ b/src/testing/testing_api_cmd_claim_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 @@ -123,34 +123,23 @@ order_claim_cleanup (void *cls, * response code is as expected. * * @param cls closure - * @param hr HTTP response we got - * @param contract_terms the contract terms; they are the - * backend-filled up order minus cryptographic - * information. - * @param sig merchant signature over the contract terms. - * @param hash hash code of the contract terms. + * @param ocr response we got */ static void order_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 OrderClaimState *pls = cls; pls->och = NULL; - if (pls->http_status != hr->http_status) + if (pls->http_status != ocr->hr.http_status) TALER_TESTING_FAIL (pls->is); - if (MHD_HTTP_OK == hr->http_status) + if (MHD_HTTP_OK == ocr->hr.http_status) { - pls->contract_terms = json_object_get (hr->reply, - "contract_terms"); - if (NULL == pls->contract_terms) - TALER_TESTING_FAIL (pls->is); - json_incref (pls->contract_terms); - pls->contract_terms_hash = *hash; - pls->merchant_sig = *sig; + pls->contract_terms + = json_incref ((json_t *) ocr->details.ok.contract_terms); + pls->contract_terms_hash = ocr->details.ok.h_contract_terms; + pls->merchant_sig = ocr->details.ok.sig; { const char *error_name; unsigned int error_line; @@ -161,7 +150,7 @@ order_claim_cb (void *cls, }; if (GNUNET_OK != - GNUNET_JSON_parse (contract_terms, + GNUNET_JSON_parse (pls->contract_terms, spec, &error_name, &error_line)) @@ -185,7 +174,7 @@ order_claim_run (void *cls, struct TALER_TESTING_Interpreter *is) { struct OrderClaimState *pls = cls; - const char **order_id; + const char *order_id; const struct GNUNET_CRYPTO_EddsaPublicKey *nonce; /* Only used if we do NOT use the nonce/token from traits. */ struct GNUNET_CRYPTO_EddsaPublicKey dummy_nonce; @@ -194,7 +183,7 @@ order_claim_run (void *cls, pls->is = is; if (NULL != pls->order_id) { - order_id = &pls->order_id; + order_id = pls->order_id; GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, &dummy_nonce, sizeof (dummy_nonce)); @@ -228,9 +217,10 @@ order_claim_run (void *cls, &order_id)) TALER_TESTING_FAIL (is); } - pls->och = TALER_MERCHANT_order_claim (is->ctx, + pls->och = TALER_MERCHANT_order_claim (TALER_TESTING_interpreter_get_context ( + is), pls->merchant_url, - *order_id, + order_id, nonce, claim_token, &order_claim_cb, |