diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c | 77 |
1 files changed, 21 insertions, 56 deletions
diff --git a/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c b/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c index 0382b742..7c2081a6 100644 --- a/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c +++ b/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c @@ -488,37 +488,20 @@ exchange_check_cb (void *cls, struct KycContext *kc = ekr->kc; ekr->kyc = NULL; - switch (ks->http_status) + switch (ks->hr.http_status) { case MHD_HTTP_OK: { enum GNUNET_DB_QueryStatus qs; - if (TALER_AML_NORMAL != ks->details.ok.aml_status) - { - GNUNET_assert ( - 0 == - json_array_append_new ( - kc->pending_kycs, - GNUNET_JSON_PACK ( - GNUNET_JSON_pack_uint64 ( - "aml_status", - ks->details.ok.aml_status), - GNUNET_JSON_pack_string ("exchange_url", - ekr->exchange_url), - GNUNET_JSON_pack_string ("payto_uri", - ekr->payto_uri)))); - } - qs = TMH_db->account_kyc_set_status (TMH_db->cls, - kc->mi->settings.id, - &ekr->h_wire, - ekr->exchange_url, - ekr->exchange_kyc_serial, - &ks->details.ok.exchange_sig, - &ks->details.ok.exchange_pub, - ks->details.ok.timestamp, - true, /* KYC OK */ - ks->details.ok.aml_status); + qs = TMH_db->account_kyc_set_status ( + TMH_db->cls, + kc->mi->settings.id, + &ekr->h_wire, + ekr->exchange_url, + ekr->exchange_kyc_serial, + GNUNET_TIME_timestamp_get (), + true); if (qs < 0) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, @@ -536,10 +519,6 @@ exchange_check_cb (void *cls, json_array_append_new ( kc->pending_kycs, GNUNET_JSON_PACK ( - GNUNET_JSON_pack_string ("kyc_url", - ks->details.accepted.kyc_url), - GNUNET_JSON_pack_uint64 ("aml_status", - ks->details.accepted.aml_status), GNUNET_JSON_pack_string ("exchange_url", ekr->exchange_url), GNUNET_JSON_pack_string ("payto_uri", @@ -551,11 +530,8 @@ exchange_check_cb (void *cls, &ekr->h_wire, ekr->exchange_url, ekr->exchange_kyc_serial, - NULL, - NULL, now, - false, /* KYC not OK */ - ks->details.accepted.aml_status); + false); if (qs < 0) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, @@ -574,11 +550,8 @@ exchange_check_cb (void *cls, &ekr->h_wire, ekr->exchange_url, ekr->exchange_kyc_serial, - NULL, - NULL, now, - true, /* KYC OK */ - TALER_AML_NORMAL); + true); if (qs < 0) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, @@ -596,9 +569,6 @@ exchange_check_cb (void *cls, json_array_append_new ( kc->pending_kycs, GNUNET_JSON_PACK ( - GNUNET_JSON_pack_uint64 ( - "aml_status", - ks->details.unavailable_for_legal_reasons.aml_status), GNUNET_JSON_pack_string ("exchange_url", ekr->exchange_url), GNUNET_JSON_pack_string ("payto_uri", @@ -610,11 +580,8 @@ exchange_check_cb (void *cls, &ekr->h_wire, ekr->exchange_url, ekr->exchange_kyc_serial, - NULL, - NULL, now, - true, /* KYC is OK, AML not... */ - ks->details.unavailable_for_legal_reasons.aml_status); + true); if (qs < 0) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, @@ -625,8 +592,8 @@ exchange_check_cb (void *cls, default: GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Exchange responded with HTTP status %u (%d) to /kyc-check request!\n", - ks->http_status, - ks->ec); + ks->hr.http_status, + ks->hr.ec); kc->response_code = MHD_HTTP_BAD_GATEWAY; GNUNET_assert ( 0 == @@ -636,9 +603,9 @@ exchange_check_cb (void *cls, GNUNET_JSON_pack_string ("exchange_url", ekr->exchange_url), GNUNET_JSON_pack_uint64 ("exchange_code", - ks->ec), + ks->hr.ec), GNUNET_JSON_pack_uint64 ("exchange_http_status", - ks->http_status)))); + ks->hr.http_status)))); } ekr_finished (ekr); } @@ -660,6 +627,8 @@ kyc_with_exchange (void *cls, struct ExchangeKycRequest *ekr = cls; struct KycContext *kc = ekr->kc; struct TALER_PaytoHashP h_payto; + union TALER_AccountPrivateKeyP ap; + (void) exchange; ekr->fo = NULL; @@ -678,13 +647,12 @@ kyc_with_exchange (void *cls, } TALER_payto_hash (ekr->payto_uri, &h_payto); + ap.merchant_priv = kc->mi->merchant_priv; ekr->kyc = TALER_EXCHANGE_kyc_check ( TMH_curl_ctx, ekr->exchange_url, - keys, ekr->exchange_kyc_serial, - &h_payto, - 1, /* FIXME: this will go away! */ + &ap, GNUNET_TIME_absolute_get_remaining (kc->timeout), &exchange_check_cb, ekr); @@ -702,7 +670,6 @@ kyc_with_exchange (void *cls, * @param exchange_url base URL of the exchange for which this is a status * @param last_check when did we last get an update on our KYC status from the exchange * @param kyc_ok true if we satisfied the KYC requirements - * @param aml_decision latest AML decision known to us */ static void kyc_status_cb (void *cls, @@ -711,14 +678,12 @@ kyc_status_cb (void *cls, const char *payto_uri, const char *exchange_url, struct GNUNET_TIME_Timestamp last_check, - bool kyc_ok, - enum TALER_AmlDecisionState aml_decision) + bool kyc_ok) { struct KycContext *kc = cls; struct ExchangeKycRequest *ekr; if (kyc_ok && - (TALER_AML_PENDING != aml_decision) && (GNUNET_TIME_relative_cmp ( GNUNET_TIME_absolute_get_duration (last_check.abs_time), <, |