summaryrefslogtreecommitdiff
path: root/src/exchangedb/pg_do_withdraw.c
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-07-23 21:18:32 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2023-07-23 21:18:32 +0200
commit5bf90c3505130bb92d518e8ae489d55095cb1cf3 (patch)
tree27bd1a47fd29043c4472e26505d213dbc103e284 /src/exchangedb/pg_do_withdraw.c
parente230eaad76f4488dc1b5dbc0aba6ab26b9423e75 (diff)
downloadexchange-5bf90c3505130bb92d518e8ae489d55095cb1cf3.tar.gz
exchange-5bf90c3505130bb92d518e8ae489d55095cb1cf3.tar.bz2
exchange-5bf90c3505130bb92d518e8ae489d55095cb1cf3.zip
kyc logic with birthdate setting test added
1. Added age-requirement check in withdraw-handler (like in batch-withdraw) 2. In test_exchange_api_age_restriction: - kyc-oauth2 started, with static birthdate in answers - withdraw triggers kyc - second withdraw fails due to age restriction requirements
Diffstat (limited to 'src/exchangedb/pg_do_withdraw.c')
-rw-r--r--src/exchangedb/pg_do_withdraw.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/exchangedb/pg_do_withdraw.c b/src/exchangedb/pg_do_withdraw.c
index 01bbfff5b..99732df6b 100644
--- a/src/exchangedb/pg_do_withdraw.c
+++ b/src/exchangedb/pg_do_withdraw.c
@@ -32,9 +32,12 @@ TEH_PG_do_withdraw (
const struct TALER_CsNonce *nonce,
const struct TALER_EXCHANGEDB_CollectableBlindcoin *collectable,
struct GNUNET_TIME_Timestamp now,
+ bool do_age_check,
bool *found,
bool *balance_ok,
bool *nonce_ok,
+ bool *age_ok,
+ uint16_t *allowed_maximum_age,
uint64_t *ruuid)
{
struct PostgresClosure *pg = cls;
@@ -51,6 +54,7 @@ TEH_PG_do_withdraw (
TALER_PQ_query_param_blinded_denom_sig (&collectable->sig),
GNUNET_PQ_query_param_timestamp (&now),
GNUNET_PQ_query_param_timestamp (&gc),
+ GNUNET_PQ_query_param_bool (do_age_check),
GNUNET_PQ_query_param_end
};
struct GNUNET_PQ_ResultSpec rs[] = {
@@ -60,6 +64,10 @@ TEH_PG_do_withdraw (
balance_ok),
GNUNET_PQ_result_spec_bool ("nonce_ok",
nonce_ok),
+ GNUNET_PQ_result_spec_bool ("age_ok",
+ age_ok),
+ GNUNET_PQ_result_spec_uint16 ("allowed_maximum_age",
+ allowed_maximum_age),
GNUNET_PQ_result_spec_uint64 ("ruuid",
ruuid),
GNUNET_PQ_result_spec_end
@@ -71,9 +79,11 @@ TEH_PG_do_withdraw (
" reserve_found"
",balance_ok"
",nonce_ok"
+ ",age_ok"
+ ",allowed_maximum_age"
",ruuid"
" FROM exchange_do_withdraw"
- " ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10);");
+ " ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11);");
gc = GNUNET_TIME_absolute_to_timestamp (
GNUNET_TIME_absolute_add (now.abs_time,
pg->legal_reserve_expiration_time));