diff options
Diffstat (limited to 'src/testing/testing_api_cmd_pay_order.c')
-rw-r--r-- | src/testing/testing_api_cmd_pay_order.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/src/testing/testing_api_cmd_pay_order.c b/src/testing/testing_api_cmd_pay_order.c index a2b7cfb3..19d01a4a 100644 --- a/src/testing/testing_api_cmd_pay_order.c +++ b/src/testing/testing_api_cmd_pay_order.c @@ -133,6 +133,16 @@ build_coins (struct TALER_MERCHANT_PayCoin **pc, const char *amount_without_fee) { char *token; + struct TALER_EXCHANGE_Handle *exchange; + const struct TALER_EXCHANGE_Keys *keys; + + exchange = TALER_TESTING_get_exchange (is); + keys = TALER_EXCHANGE_get_keys (exchange); + if (NULL == keys) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } for (token = strtok (coins, ";"); NULL != token; @@ -143,7 +153,7 @@ build_coins (struct TALER_MERCHANT_PayCoin **pc, unsigned int ci; struct TALER_MERCHANT_PayCoin *icoin; const struct TALER_EXCHANGE_DenomPublicKey *dpk; - const char **exchange_url; + const char *exchange_url; /* Token syntax is "LABEL[/NUMBER]" */ ctok = strchr (token, '/'); @@ -210,7 +220,7 @@ build_coins (struct TALER_MERCHANT_PayCoin **pc, icoin->h_age_commitment = h_age_commitment; } GNUNET_assert (NULL != (dpk = - TALER_TESTING_find_pk (is->keys, + TALER_TESTING_find_pk (keys, &icoin->denom_value, false))); @@ -221,7 +231,7 @@ build_coins (struct TALER_MERCHANT_PayCoin **pc, GNUNET_assert (GNUNET_OK == TALER_TESTING_get_trait_exchange_url (coin_cmd, &exchange_url)); - icoin->exchange_url = *exchange_url; + icoin->exchange_url = exchange_url; } return GNUNET_OK; @@ -324,7 +334,6 @@ pay_run (void *cls, struct TALER_MERCHANT_PayCoin *pay_coins; unsigned int npay_coins; const struct TALER_MerchantSignatureP *merchant_sig; - const char **pos_key_ptr; const enum TALER_MerchantConfirmationAlgorithm *alg_ptr; ps->is = is; @@ -341,10 +350,10 @@ pay_run (void *cls, TALER_TESTING_FAIL (is); if (NULL == contract_terms) TALER_TESTING_FAIL (is); - if (GNUNET_OK == + if (GNUNET_OK != TALER_TESTING_get_trait_template_pos_key (proposal_cmd, - &pos_key_ptr)) - ps->pos_key = *pos_key_ptr; + &ps->pos_key)) + ps->pos_key = NULL; if (GNUNET_OK == TALER_TESTING_get_trait_template_pos_alg (proposal_cmd, &alg_ptr)) @@ -425,7 +434,8 @@ pay_run (void *cls, &h_proposal)) TALER_TESTING_FAIL (is); ps->h_contract_terms = *h_proposal; - ps->oph = TALER_MERCHANT_order_pay (is->ctx, + ps->oph = TALER_MERCHANT_order_pay (TALER_TESTING_interpreter_get_context ( + is), ps->merchant_url, ps->session_id, h_proposal, @@ -492,7 +502,7 @@ pay_traits (void *cls, { struct PayState *ps = cls; - const char **order_id; + const char *order_id; const struct TALER_TESTING_Command *proposal_cmd; const struct TALER_MerchantPublicKeyP *merchant_pub; @@ -528,14 +538,14 @@ pay_traits (void *cls, &amount_with_fee)); { struct TALER_TESTING_Trait traits[] = { - TALER_TESTING_make_trait_proposal_reference (&ps->proposal_reference), + TALER_TESTING_make_trait_proposal_reference (ps->proposal_reference), TALER_TESTING_make_trait_coin_reference (0, - &ps->coin_reference), + ps->coin_reference), TALER_TESTING_make_trait_order_id (order_id), TALER_TESTING_make_trait_merchant_pub (merchant_pub), TALER_TESTING_make_trait_merchant_sig (&ps->merchant_sig), TALER_TESTING_make_trait_amount (&amount_with_fee), - TALER_TESTING_make_trait_template_pos_key (&ps->pos_key), + TALER_TESTING_make_trait_template_pos_key (ps->pos_key), TALER_TESTING_make_trait_template_pos_alg (&ps->pos_alg), TALER_TESTING_trait_end () }; |