diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-01-13 22:01:45 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-01-13 22:01:45 +0100 |
commit | 7b1909bc99690999d06767cfe6d9947e83974174 (patch) | |
tree | b71ebd088d7018b864f180f8f7e1ac659c86ea7a /src/util | |
parent | 2d16cddfd9f3d58f696313b8c2decb9da0e9cf7a (diff) | |
download | exchange-7b1909bc99690999d06767cfe6d9947e83974174.tar.xz |
make fakebank and banklib match specifified new API
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/util.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/util/util.c b/src/util/util.c index e312e345b..50ac5c1a7 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -776,4 +776,33 @@ 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 ends_slash; + + if (0 < strlen (bank_url)) + ends_slash = '/' == bank_url[strlen (bank_url) - 1]; + else + ends_slash = 0; + GNUNET_asprintf (&payto, + (ends_slash) + ? "payto://x-taler-bank/%s%s" + : "payto://x-taler-bank/%s/%s", + bank_url, + account_name); + return payto; +} + + /* end of util.c */ |