diff options
Diffstat (limited to 'src/testing/testing_api_cmd_post_orders.c')
-rw-r--r-- | src/testing/testing_api_cmd_post_orders.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/testing/testing_api_cmd_post_orders.c b/src/testing/testing_api_cmd_post_orders.c index 89369853..119245a7 100644 --- a/src/testing/testing_api_cmd_post_orders.c +++ b/src/testing/testing_api_cmd_post_orders.c @@ -78,6 +78,11 @@ struct OrdersState struct GNUNET_CRYPTO_EddsaPublicKey nonce; /** + * The claim token + */ + struct TALER_ClaimTokenP *claim_token; + + /** * URL of the merchant backend. */ const char *merchant_url; @@ -143,6 +148,7 @@ orders_traits (void *cls, TALER_TESTING_make_trait_merchant_sig (0, &ps->merchant_sig), TALER_TESTING_make_trait_merchant_pub (0, &ps->merchant_pub), TALER_TESTING_make_trait_claim_nonce (0, &ps->nonce), + TALER_TESTING_make_trait_claim_token (0, ps->claim_token), TALER_TESTING_trait_end () }; @@ -225,11 +231,15 @@ orders_claim_cb (void *cls, static void order_cb (void *cls, const struct TALER_MERCHANT_HttpResponse *hr, - const char *order_id) + const char *order_id, + const struct TALER_ClaimTokenP *claim_token) { struct OrdersState *ps = cls; ps->po = NULL; + if (NULL != claim_token) + ps->claim_token = GNUNET_memdup (claim_token, + sizeof (struct TALER_ClaimTokenP)); if (ps->http_status != hr->http_status) { TALER_LOG_ERROR ("Given vs expected: %u(%d) vs %u\n", @@ -279,6 +289,7 @@ order_cb (void *cls, ps->merchant_url, ps->order_id, &ps->nonce, + ps->claim_token, &orders_claim_cb, ps))) TALER_TESTING_FAIL (ps->is); @@ -467,6 +478,7 @@ orders_run2 (void *cls, products, locks_length, locks, + true, &order_cb, ps); json_decref (order); @@ -517,6 +529,8 @@ orders_cleanup (void *cls, json_decref (ps->contract_terms); GNUNET_free (ps->order); GNUNET_free_nz ((void *) ps->order_id); + if (NULL != ps->claim_token) + GNUNET_free (ps->claim_token); GNUNET_free (ps); } |