summaryrefslogtreecommitdiff
path: root/src/util/payto.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-05-30 16:31:24 +0200
committerChristian Grothoff <christian@grothoff.org>2022-05-30 16:31:24 +0200
commit7b25787a4b8ac0a0b3cbc2174ba3cac9c564346a (patch)
tree60e9259939dca8f9bb9ad2539d594fb15e67a170 /src/util/payto.c
parent7f902c0fc9bc7e0832d01169e6f580ab671fbf08 (diff)
downloadexchange-7b25787a4b8ac0a0b3cbc2174ba3cac9c564346a.tar.gz
exchange-7b25787a4b8ac0a0b3cbc2174ba3cac9c564346a.tar.bz2
exchange-7b25787a4b8ac0a0b3cbc2174ba3cac9c564346a.zip
-generate 404 on non-existing accounts for fakebank, use payto://-URIs with receiver-name in tests
Diffstat (limited to 'src/util/payto.c')
-rw-r--r--src/util/payto.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/util/payto.c b/src/util/payto.c
index 442107a0f..ceceecf52 100644
--- a/src/util/payto.c
+++ b/src/util/payto.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2019-2021 Taler Systems SA
+ Copyright (C) 2019-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
@@ -233,6 +233,26 @@ TALER_payto_validate (const char *payto_uri)
}
+char *
+TALER_payto_get_receiver_name (const char *payto)
+{
+ char *err;
+
+ err = TALER_payto_validate (payto);
+ if (NULL != err)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Invalid payto://-URI `%s': %s\n",
+ payto,
+ err);
+ GNUNET_free (err);
+ return NULL;
+ }
+ return payto_get_key (payto,
+ "receiver-name=");
+}
+
+
void
TALER_payto_hash (const char *payto,
struct TALER_PaytoHashP *h_payto)