aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/taler_util.h35
-rw-r--r--src/lib/testing_api_cmd_bank_admin_add_incoming.c11
-rw-r--r--src/util/test_payto.c35
-rw-r--r--src/util/util.c149
4 files changed, 2 insertions, 228 deletions
diff --git a/src/include/taler_util.h b/src/include/taler_util.h
index 37b6765a2..335b123c3 100644
--- a/src/include/taler_util.h
+++ b/src/include/taler_util.h
@@ -246,41 +246,6 @@ TALER_payto_get_method (const char *payto_url);
/**
- * Create an x-taler-bank payto:// URL from a @a bank_url
- * and an @a account_name.
- *
- * @param bank_url the bank URL
- * @param account_name the account name
- * @return payto:// URL
- */
-char *
-TALER_payto_xtalerbank_make (const char *bank_url,
- const char *account_name);
-
-
-/**
- * Create an x-taler-bank payto:// URL from an @a account_url.
- *
- * @param account_url the bank URL
- * @param account_name the account name
- * @return payto:// URL
- */
-char *
-TALER_payto_xtalerbank_make2 (const char *account_url);
-
-
-/**
- * Given an x-taler-bank payto:// URL, compute
- * the HTTP(S) base URL of the account.
- *
- * @param payto the payto URL
- * @return bank URL of the account, NULL if not x-taler-bak payto URL
- */
-char *
-TALER_xtalerbank_base_url_from_payto (const char *payto);
-
-
-/**
* Obtain the account name from a payto URL.
*
* @param payto an x-taler-bank payto URL
diff --git a/src/lib/testing_api_cmd_bank_admin_add_incoming.c b/src/lib/testing_api_cmd_bank_admin_add_incoming.c
index c59ef85f3..2e274fbc3 100644
--- a/src/lib/testing_api_cmd_bank_admin_add_incoming.c
+++ b/src/lib/testing_api_cmd_bank_admin_add_incoming.c
@@ -59,11 +59,6 @@ struct AdminAddIncomingState
const char *payto_debit_account;
/**
- * Money receiver payto URL.
- */
- char *payto_credit_account;
-
- /**
* Username to use for authentication.
*/
struct TALER_BANK_AuthenticationData auth;
@@ -381,7 +376,6 @@ admin_add_incoming_cleanup (void *cls,
GNUNET_SCHEDULER_cancel (fts->retry_task);
fts->retry_task = NULL;
}
- GNUNET_free (fts->payto_credit_account);
GNUNET_free (fts);
}
@@ -407,8 +401,9 @@ admin_add_incoming_traits (void *cls,
TALER_TESTING_make_trait_bank_row (&fts->serial_id),
TALER_TESTING_make_trait_payto (TALER_TESTING_PT_DEBIT,
fts->payto_debit_account),
+ /* Used as a marker, content does not matter */
TALER_TESTING_make_trait_payto (TALER_TESTING_PT_CREDIT,
- fts->payto_credit_account),
+ "payto://void/the-exchange"),
TALER_TESTING_make_trait_url (TALER_TESTING_UT_EXCHANGE_BANK_ACCOUNT_URL,
fts->exchange_credit_url),
TALER_TESTING_make_trait_amount_obj (0, &fts->amount),
@@ -447,8 +442,6 @@ make_fts (const char *amount,
fts = GNUNET_new (struct AdminAddIncomingState);
fts->exchange_credit_url = exchange_base_url;
fts->payto_debit_account = payto_debit_account;
- fts->payto_credit_account
- = TALER_payto_xtalerbank_make2 (exchange_base_url);
fts->auth = *auth;
if (GNUNET_OK !=
TALER_string_to_amount (amount,
diff --git a/src/util/test_payto.c b/src/util/test_payto.c
index 5807be20b..b7d73f80a 100644
--- a/src/util/test_payto.c
+++ b/src/util/test_payto.c
@@ -42,41 +42,6 @@ main (int argc,
GNUNET_log_setup ("test-payto",
"WARNING",
NULL);
- r = TALER_payto_xtalerbank_make ("https://localhost/",
- "account");
- CHECK ("payto://x-taler-bank/localhost/account",
- r);
- r = TALER_payto_xtalerbank_make ("https://localhost",
- "account");
- CHECK ("payto://x-taler-bank/localhost/account",
- r);
- r = TALER_payto_xtalerbank_make2 ("https://localhost/account");
- CHECK ("payto://x-taler-bank/localhost/account",
- r);
- r = TALER_payto_xtalerbank_make ("http://localhost:80/",
- "account");
- CHECK ("payto://x-taler-bank/localhost:80/account",
- r);
- r = TALER_payto_xtalerbank_make ("http://localhost:80",
- "account");
- CHECK ("payto://x-taler-bank/localhost:80/account",
- r);
- r = TALER_payto_xtalerbank_make ("http://localhost/",
- "account");
- r = TALER_payto_xtalerbank_make2 ("http://localhost:80/account");
- CHECK ("payto://x-taler-bank/localhost:80/account",
- r);
- r = TALER_payto_xtalerbank_make2 ("http://localhost/account");
- CHECK ("payto://x-taler-bank/localhost:80/account",
- r);
- r = TALER_xtalerbank_base_url_from_payto (
- "payto://x-taler-bank/localhost/bob");
- CHECK ("https://localhost/",
- r);
- r = TALER_xtalerbank_base_url_from_payto (
- "payto://x-taler-bank/localhost:1080/bob");
- CHECK ("http://localhost:1080/",
- r);
r = TALER_xtalerbank_account_from_payto (
"payto://x-taler-bank/localhost:1080/alice");
CHECK ("alice",
diff --git a/src/util/util.c b/src/util/util.c
index 36c6f440c..c9316462b 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -571,155 +571,6 @@ TALER_payto_get_method (const char *payto_url)
/**
- * Create an x-taler-bank payto:// URL from a @a bank_url
- * and an @a account_name.
- *
- * @param bank_url the bank URL
- * @param account_name the account name
- * @return payto:// URL
- */
-char *
-TALER_payto_xtalerbank_make (const char *bank_url,
- const char *account_name)
-{
- char *payto;
- int plaintext;
- const char *port;
- size_t slen;
-
- if (0 == strncasecmp ("https://",
- bank_url,
- strlen ("https://")))
- {
- bank_url += strlen ("https://");
- plaintext = GNUNET_NO;
- }
- else if (0 == strncasecmp ("http://",
- bank_url,
- strlen ("http://")))
- {
- bank_url += strlen ("http://");
- plaintext = GNUNET_YES;
- }
- else
- return NULL;
- slen = strlen (bank_url);
- port = memchr (bank_url,
- ':',
- slen);
- if ( (0 < slen) &&
- ('/' == bank_url[slen - 1]) )
- slen--;
- GNUNET_asprintf (&payto,
- ( (NULL == port) && (GNUNET_YES == plaintext) )
- ? "payto://x-taler-bank/%.*s:80/%s"
- : "payto://x-taler-bank/%.*s/%s",
- (int) slen,
- bank_url,
- account_name);
- return payto;
-}
-
-
-/**
- * Create an x-taler-bank payto:// URL from an @a account_url.
- *
- * @param account_url the bank URL
- * @param account_name the account name
- * @return payto:// URL
- */
-char *
-TALER_payto_xtalerbank_make2 (const char *account_url)
-{
- char *payto;
- int plaintext;
- const char *port;
- size_t slen;
- const char *account;
-
- if (0 == strncasecmp ("https://",
- account_url,
- strlen ("https://")))
- {
- account_url += strlen ("https://");
- plaintext = GNUNET_NO;
- }
- else if (0 == strncasecmp ("http://",
- account_url,
- strlen ("http://")))
- {
- account_url += strlen ("http://");
- plaintext = GNUNET_YES;
- }
- else
- return NULL;
- account = strchr (account_url,
- '/');
- if (NULL == account)
- return NULL;
- slen = account - account_url;
- port = memchr (account_url,
- ':',
- slen);
- if ( (0 < slen) &&
- ('/' == account_url[slen - 1]) )
- slen--;
- GNUNET_asprintf (&payto,
- ( (NULL == port) && (GNUNET_YES == plaintext) )
- ? "payto://x-taler-bank/%.*s:80/%s"
- : "payto://x-taler-bank/%.*s/%s",
- (int) slen,
- account_url,
- account + 1);
- return payto;
-}
-
-
-/**
- * Given an x-taler-bank payto:// URL, compute
- * the HTTP(S) base URL of the account.
- *
- * @param payto the payto URL
- * @return bank URL of the account, NULL if not x-taler-bak payto URL
- */
-char *
-TALER_xtalerbank_base_url_from_payto (const char *payto)
-{
- const char *start;
- const char *end;
- char *ret;
- int https;
- const char *colon;
- unsigned int port;
-
- if (0 != strncasecmp (payto,
- "payto://x-taler-bank/",
- strlen ("payto://x-taler-bank/")))
- return NULL;
- start = &payto[strlen ("payto://x-taler-bank/")];
- end = strchr (start,
- '/');
- if (NULL == end)
- end = &start[strlen (start)];
- colon = strrchr (start,
- ':');
- https = GNUNET_YES;
- if ( (NULL != colon) &&
- (1 == sscanf (colon + 1,
- "%u",
- &port)) &&
- (443 != port) )
- https = GNUNET_NO;
- GNUNET_asprintf (&ret,
- "%s://%.*s/",
- (https ? "https" : "http"),
- (int) (end - start),
- start);
- return ret;
-}
-
-
-/**
* Obtain the account name from a payto URL.
*
* @param payto an x-taler-bank payto URL