diff options
-rw-r--r-- | src/lib/merchant_api_get_account.c | 8 | ||||
-rw-r--r-- | src/lib/merchant_api_get_accounts.c | 4 | ||||
-rw-r--r-- | src/lib/merchant_api_get_kyc.c | 10 | ||||
-rw-r--r-- | src/lib/merchant_api_get_transfers.c | 61 | ||||
-rw-r--r-- | src/lib/merchant_api_post_account.c | 6 | ||||
-rw-r--r-- | src/lib/merchant_api_post_transfers.c | 6 |
6 files changed, 50 insertions, 45 deletions
diff --git a/src/lib/merchant_api_get_account.c b/src/lib/merchant_api_get_account.c index 84595e80..c0355bfb 100644 --- a/src/lib/merchant_api_get_account.c +++ b/src/lib/merchant_api_get_account.c @@ -74,8 +74,8 @@ struct TALER_MERCHANT_AccountGetHandle */ static void handle_get_account_finished (void *cls, - long response_code, - const void *response) + long response_code, + const void *response) { struct TALER_MERCHANT_AccountGetHandle *tgh = cls; const json_t *json = response; @@ -99,8 +99,8 @@ handle_get_account_finished (void *cls, TALER_JSON_spec_web_url ("credit_facade_url", &tgr.details.ok.ad.credit_facade_url), NULL), - TALER_JSON_spec_payto_uri ("payto_uri", - &tgr.details.ok.ad.payto_uri), + TALER_JSON_spec_full_payto_uri ("payto_uri", + &tgr.details.ok.ad.payto_uri), GNUNET_JSON_spec_fixed_auto ("h_wire", &tgr.details.ok.ad.h_wire), GNUNET_JSON_spec_bool ("active", diff --git a/src/lib/merchant_api_get_accounts.c b/src/lib/merchant_api_get_accounts.c index c08cd92d..5863b9d8 100644 --- a/src/lib/merchant_api_get_accounts.c +++ b/src/lib/merchant_api_get_accounts.c @@ -97,8 +97,8 @@ parse_accounts (const json_t *ia, json_array_foreach (ia, index, value) { struct TALER_MERCHANT_AccountEntry *ie = &tmpl[index]; struct GNUNET_JSON_Specification spec[] = { - TALER_JSON_spec_payto_uri ("payto_uri", - &ie->payto_uri), + TALER_JSON_spec_full_payto_uri ("payto_uri", + &ie->payto_uri), GNUNET_JSON_spec_fixed_auto ("h_wire", &ie->h_wire), GNUNET_JSON_spec_end () diff --git a/src/lib/merchant_api_get_kyc.c b/src/lib/merchant_api_get_kyc.c index 0c9f610b..2a2ab8e2 100644 --- a/src/lib/merchant_api_get_kyc.c +++ b/src/lib/merchant_api_get_kyc.c @@ -136,7 +136,7 @@ parse_kyc (struct TALER_MERCHANT_KycGetHandle *kyc, GNUNET_NZL (num_kycs)]; struct TALER_EXCHANGE_AccountLimit limits[ GNUNET_NZL (num_limits)]; - const char *payto_kycauths[ + struct TALER_FullPayto payto_kycauths[ GNUNET_NZL (num_kycauths)]; memset (kycs, @@ -150,7 +150,7 @@ parse_kyc (struct TALER_MERCHANT_KycGetHandle *kyc, const json_t *jkycauths = NULL; uint32_t hs; struct GNUNET_JSON_Specification spec[] = { - TALER_JSON_spec_payto_uri ( + TALER_JSON_spec_full_payto_uri ( "payto_uri", &rd->payto_uri), TALER_JSON_spec_web_url ( @@ -250,9 +250,9 @@ parse_kyc (struct TALER_MERCHANT_KycGetHandle *kyc, json_array_foreach (jkycauths, j, jkycauth) { GNUNET_assert (pos_kycauths < num_kycauths); - payto_kycauths[pos_kycauths] - = json_string_value (jkycauth); - if (NULL == payto_kycauths[pos_kycauths]) + payto_kycauths[pos_kycauths].full_payto + = (char *) json_string_value (jkycauth); + if (NULL == payto_kycauths[pos_kycauths].full_payto) { GNUNET_break (0); json_dumpf (json_array_get (jkyc, diff --git a/src/lib/merchant_api_get_transfers.c b/src/lib/merchant_api_get_transfers.c index 2995be11..5f879e9a 100644 --- a/src/lib/merchant_api_get_transfers.c +++ b/src/lib/merchant_api_get_transfers.c @@ -130,8 +130,8 @@ handle_transfers_get_finished (void *cls, &td->credit_amount), GNUNET_JSON_spec_fixed_auto ("wtid", &td->wtid), - TALER_JSON_spec_payto_uri ("payto_uri", - &td->payto_uri), + TALER_JSON_spec_full_payto_uri ("payto_uri", + &td->payto_uri), TALER_JSON_spec_web_url ("exchange_url", &td->exchange_url), GNUNET_JSON_spec_uint64 ("transfer_serial_id", @@ -219,7 +219,7 @@ struct TALER_MERCHANT_GetTransfersHandle * TALER_MERCHANT_transfers_get ( struct GNUNET_CURL_Context *ctx, const char *backend_url, - const char *payto_uri, + struct TALER_FullPayto payto_uri, const struct GNUNET_TIME_Timestamp before, const struct GNUNET_TIME_Timestamp after, int64_t limit, @@ -259,31 +259,36 @@ TALER_MERCHANT_transfers_get ( sizeof (after_s), "%llu", (unsigned long long) GNUNET_TIME_timestamp_to_s (after)); - gth->url = TALER_url_join (backend_url, - "private/transfers", - "payto_uri", - payto_uri, - "verified", - (TALER_EXCHANGE_YNA_ALL != verified) - ? verified_s - : NULL, - "limit", - 0 != limit - ? limit_s - : NULL, - "offset", - ((0 != offset) && (UINT64_MAX != offset)) - ? offset_s - : NULL, - "before", - GNUNET_TIME_absolute_is_never (before.abs_time) - ? NULL - : before_s, - "after", - GNUNET_TIME_absolute_is_zero (after.abs_time) - ? NULL - : after_s, - NULL); + { + char *enc_payto = TALER_urlencode (payto_uri.full_payto); + + gth->url = TALER_url_join (backend_url, + "private/transfers", + "payto_uri", + enc_payto, + "verified", + (TALER_EXCHANGE_YNA_ALL != verified) + ? verified_s + : NULL, + "limit", + 0 != limit + ? limit_s + : NULL, + "offset", + ((0 != offset) && (UINT64_MAX != offset)) + ? offset_s + : NULL, + "before", + GNUNET_TIME_absolute_is_never (before.abs_time) + ? NULL + : before_s, + "after", + GNUNET_TIME_absolute_is_zero (after.abs_time) + ? NULL + : after_s, + NULL); + GNUNET_free (enc_payto); + } if (NULL == gth->url) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, diff --git a/src/lib/merchant_api_post_account.c b/src/lib/merchant_api_post_account.c index 690aef17..3130b690 100644 --- a/src/lib/merchant_api_post_account.c +++ b/src/lib/merchant_api_post_account.c @@ -116,7 +116,7 @@ handle_post_account_finished (void *cls, GNUNET_JSON_parse (json, spec, NULL, NULL)) - { + { GNUNET_break_op (0); apr.hr.http_status = 0; apr.hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE; @@ -175,7 +175,7 @@ struct TALER_MERCHANT_AccountsPostHandle * TALER_MERCHANT_accounts_post ( struct GNUNET_CURL_Context *ctx, const char *backend_url, - const char *payto_uri, + struct TALER_FullPayto payto_uri, const char *credit_facade_url, const json_t *credit_facade_credentials, TALER_MERCHANT_AccountsPostCallback cb, @@ -185,7 +185,7 @@ TALER_MERCHANT_accounts_post ( json_t *req_obj; req_obj = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_string ( + TALER_JSON_pack_full_payto ( "payto_uri", payto_uri), GNUNET_JSON_pack_allow_null ( diff --git a/src/lib/merchant_api_post_transfers.c b/src/lib/merchant_api_post_transfers.c index 615453fa..85856b26 100644 --- a/src/lib/merchant_api_post_transfers.c +++ b/src/lib/merchant_api_post_transfers.c @@ -183,7 +183,7 @@ TALER_MERCHANT_transfers_post ( const char *backend_url, const struct TALER_Amount *credit_amount, const struct TALER_WireTransferIdentifierRawP *wtid, - const char *payto_uri, + struct TALER_FullPayto payto_uri, const char *exchange_url, TALER_MERCHANT_PostTransfersCallback cb, void *cb_cls) @@ -211,8 +211,8 @@ TALER_MERCHANT_transfers_post ( credit_amount), GNUNET_JSON_pack_data_auto ("wtid", wtid), - GNUNET_JSON_pack_string ("payto_uri", - payto_uri), + TALER_JSON_pack_full_payto ("payto_uri", + payto_uri), GNUNET_JSON_pack_string ("exchange_url", exchange_url)); eh = TALER_MERCHANT_curl_easy_get_ (pth->url); |