summaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_kyc_proof.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/exchange_api_kyc_proof.c')
-rw-r--r--src/lib/exchange_api_kyc_proof.c46
1 files changed, 19 insertions, 27 deletions
diff --git a/src/lib/exchange_api_kyc_proof.c b/src/lib/exchange_api_kyc_proof.c
index d3debbdb9..e7cc9c4cf 100644
--- a/src/lib/exchange_api_kyc_proof.c
+++ b/src/lib/exchange_api_kyc_proof.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2021 Taler Systems SA
+ Copyright (C) 2021, 2022 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 published by the Free Software
@@ -37,11 +37,6 @@ struct TALER_EXCHANGE_KycProofHandle
{
/**
- * The connection to exchange this request handle will use
- */
- struct TALER_EXCHANGE_Handle *exchange;
-
- /**
* The url for this request.
*/
char *url;
@@ -140,24 +135,22 @@ handle_kyc_proof_finished (void *cls,
struct TALER_EXCHANGE_KycProofHandle *
-TALER_EXCHANGE_kyc_proof (struct TALER_EXCHANGE_Handle *exchange,
- const struct TALER_PaytoHashP *h_payto,
- const char *code,
- const char *state,
- TALER_EXCHANGE_KycProofCallback cb,
- void *cb_cls)
+TALER_EXCHANGE_kyc_proof (
+ struct GNUNET_CURL_Context *ctx,
+ const char *url,
+ const struct TALER_PaytoHashP *h_payto,
+ const char *logic,
+ const char *args,
+ TALER_EXCHANGE_KycProofCallback cb,
+ void *cb_cls)
{
struct TALER_EXCHANGE_KycProofHandle *kph;
- struct GNUNET_CURL_Context *ctx;
char *arg_str;
- if (GNUNET_YES !=
- TEAH_handle_is_ready (exchange))
- {
- GNUNET_break (0);
- return NULL;
- }
- /* TODO: any escaping of code/state needed??? */
+ if (NULL == args)
+ args = "";
+ else
+ GNUNET_assert (args[0] == '&');
{
char hstr[sizeof (struct TALER_PaytoHashP) * 2];
char *end;
@@ -168,17 +161,17 @@ TALER_EXCHANGE_kyc_proof (struct TALER_EXCHANGE_Handle *exchange,
sizeof (hstr));
*end = '\0';
GNUNET_asprintf (&arg_str,
- "/kyc-proof/%s?code=%s&state=%s",
+ "kyc-proof/%s?state=%s%s",
+ logic,
hstr,
- code,
- state);
+ args);
}
kph = GNUNET_new (struct TALER_EXCHANGE_KycProofHandle);
- kph->exchange = exchange;
kph->cb = cb;
kph->cb_cls = cb_cls;
- kph->url = TEAH_path_to_url (exchange,
- arg_str);
+ kph->url = TALER_url_join (url,
+ arg_str,
+ NULL);
GNUNET_free (arg_str);
if (NULL == kph->url)
{
@@ -199,7 +192,6 @@ TALER_EXCHANGE_kyc_proof (struct TALER_EXCHANGE_Handle *exchange,
curl_easy_setopt (kph->eh,
CURLOPT_FOLLOWLOCATION,
0L));
- ctx = TEAH_handle_to_context (exchange);
kph->job = GNUNET_CURL_job_add_raw (ctx,
kph->eh,
NULL,