From 5bf90c3505130bb92d518e8ae489d55095cb1cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Sun, 23 Jul 2023 21:18:32 +0200 Subject: 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 --- src/lib/exchange_api_withdraw2.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/lib') diff --git a/src/lib/exchange_api_withdraw2.c b/src/lib/exchange_api_withdraw2.c index bf9e2c091..6de7adccb 100644 --- a/src/lib/exchange_api_withdraw2.c +++ b/src/lib/exchange_api_withdraw2.c @@ -285,6 +285,12 @@ handle_reserve_withdraw_finished (void *cls, w2r.hr.hint = TALER_JSON_get_error_hint (j); break; case MHD_HTTP_CONFLICT: + w2r.hr.ec = TALER_JSON_get_error_code (j); + w2r.hr.hint = TALER_JSON_get_error_hint (j); + + if (TALER_EC_EXCHANGE_RESERVES_AGE_RESTRICTION_REQUIRED == w2r.hr.ec) + break; + /* The exchange says that the reserve has insufficient funds; check the signatures in the history... */ if (GNUNET_OK != @@ -295,11 +301,6 @@ handle_reserve_withdraw_finished (void *cls, w2r.hr.http_status = 0; w2r.hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED; } - else - { - w2r.hr.ec = TALER_JSON_get_error_code (j); - w2r.hr.hint = TALER_JSON_get_error_hint (j); - } break; case MHD_HTTP_GONE: /* could happen if denomination was revoked */ -- cgit v1.2.3