summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_purses_merge.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-06-04 15:19:57 +0200
committerChristian Grothoff <christian@grothoff.org>2022-06-04 15:19:57 +0200
commit93943bdb5b6ab43b6bcfdb721f67674cc89250d6 (patch)
tree17e98a062ba886f1389ce99f5cb2fecb242a5f76 /src/exchange/taler-exchange-httpd_purses_merge.c
parent3e99c50c0f940fda34585225c38c9014cc1110d0 (diff)
downloadexchange-93943bdb5b6ab43b6bcfdb721f67674cc89250d6.tar.gz
exchange-93943bdb5b6ab43b6bcfdb721f67674cc89250d6.tar.bz2
exchange-93943bdb5b6ab43b6bcfdb721f67674cc89250d6.zip
add KYC errors for p2p payments
Diffstat (limited to 'src/exchange/taler-exchange-httpd_purses_merge.c')
-rw-r--r--src/exchange/taler-exchange-httpd_purses_merge.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-httpd_purses_merge.c b/src/exchange/taler-exchange-httpd_purses_merge.c
index b0055edab..14dba5232 100644
--- a/src/exchange/taler-exchange-httpd_purses_merge.c
+++ b/src/exchange/taler-exchange-httpd_purses_merge.c
@@ -223,6 +223,8 @@ merge_transaction (void *cls,
bool in_conflict = true;
bool no_balance = true;
bool no_partner = true;
+ bool no_kyc = true;
+ bool no_reserve = true;
// FIXME: add KYC-check logic!
qs = TEH_plugin->do_purse_merge (TEH_plugin->cls,
@@ -234,6 +236,8 @@ merge_transaction (void *cls,
&pcc->reserve_pub,
&no_partner,
&no_balance,
+ &no_reserve,
+ &no_kyc,
&in_conflict);
if (qs < 0)
{
@@ -257,6 +261,25 @@ merge_transaction (void *cls,
pcc->provider_url);
return GNUNET_DB_STATUS_HARD_ERROR;
}
+ if (no_reserve)
+ {
+ *mhd_ret =
+ TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_NOT_FOUND,
+ TALER_EC_EXCHANGE_GENERIC_RESERVE_UNKNOWN,
+ NULL);
+ return GNUNET_DB_STATUS_HARD_ERROR;
+ }
+ if (no_kyc)
+ {
+ *mhd_ret
+ = TALER_MHD_REPLY_JSON_PACK (
+ connection,
+ MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS,
+ TALER_JSON_pack_ec (
+ TALER_EC_EXCHANGE_GENERIC_KYC_REQUIRED));
+ return GNUNET_DB_STATUS_HARD_ERROR;
+ }
if (no_balance)
{
*mhd_ret =