diff options
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 |
commit | 5bf90c3505130bb92d518e8ae489d55095cb1cf3 (patch) | |
tree | 27bd1a47fd29043c4472e26505d213dbc103e284 /src/lib/exchange_api_withdraw2.c | |
parent | e230eaad76f4488dc1b5dbc0aba6ab26b9423e75 (diff) | |
download | exchange-5bf90c3505130bb92d518e8ae489d55095cb1cf3.tar.xz |
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/lib/exchange_api_withdraw2.c')
-rw-r--r-- | src/lib/exchange_api_withdraw2.c | 11 |
1 files changed, 6 insertions, 5 deletions
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 */ |