diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-07-03 17:25:54 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-07-03 17:25:54 +0200 |
commit | 6391fb92a27b3c0f650e8d163fc4c1152b28ac09 (patch) | |
tree | d71191c7d9509ad77974cb85d76a9e3b21f02709 | |
parent | 29ac46d70cf1cfae46ca34a3785b5cfe731da72f (diff) | |
download | merchant-6391fb92a27b3c0f650e8d163fc4c1152b28ac09.tar.gz merchant-6391fb92a27b3c0f650e8d163fc4c1152b28ac09.tar.bz2 merchant-6391fb92a27b3c0f650e8d163fc4c1152b28ac09.zip |
adapt to latest exchange API changes
-rw-r--r-- | src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c | 36 |
1 files changed, 12 insertions, 24 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 5e229b48..7c2f7a2c 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 @@ -73,7 +73,7 @@ struct ExchangeKycRequest /** * Find operation where we connect to the respective exchange. */ - struct TMH_EXCHANGES_FindOperation *fo; + struct TMH_EXCHANGES_Find2Operation *fo; /** * KYC request this exchange request is made for. @@ -278,7 +278,7 @@ kyc_context_cleanup (void *cls) } if (NULL != ekr->fo) { - TMH_EXCHANGES_find_exchange_cancel (ekr->fo); + TMH_EXCHANGES_keys4exchange_cancel (ekr->fo); ekr->fo = NULL; } GNUNET_free (ekr->exchange_url); @@ -395,7 +395,7 @@ handle_kyc_timeout (void *cls) } if (NULL != ekr->fo) { - TMH_EXCHANGES_find_exchange_cancel (ekr->fo); + TMH_EXCHANGES_keys4exchange_cancel (ekr->fo); ekr->fo = NULL; } GNUNET_assert ( @@ -649,47 +649,36 @@ exchange_check_cb (void *cls, * operation. Runs the KYC check against the exchange. * * @param cls closure with our `struct ExchangeKycRequest *` - * @param hr HTTP response details - * @param eh handle to the exchange context - * @param ih internal handle to the exchange + * @param keys keys of the exchange context */ static void kyc_with_exchange (void *cls, - const struct TALER_EXCHANGE_HttpResponse *hr, - struct TALER_EXCHANGE_Handle *eh, - struct TMH_Exchange *ih) + struct TALER_EXCHANGE_Keys *keys) { struct ExchangeKycRequest *ekr = cls; struct KycContext *kc = ekr->kc; struct TALER_PaytoHashP h_payto; - (void) ih; ekr->fo = NULL; - if (MHD_HTTP_OK != hr->http_status) + if (NULL == keys) { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "Exchange responded with HTTP status %u (%d) to /kyc-check request!\n", - hr->http_status, - hr->ec); kc->response_code = MHD_HTTP_BAD_GATEWAY; GNUNET_assert ( 0 == json_array_append_new ( kc->timeout_kycs, GNUNET_JSON_PACK ( - GNUNET_JSON_pack_string ("exchange_url", - ekr->exchange_url), - GNUNET_JSON_pack_uint64 ("exchange_code", - hr->ec), - GNUNET_JSON_pack_uint64 ("exchange_http_status", - hr->http_status)))); + TALER_JSON_pack_ec ( + TALER_EC_MERCHANT_GENERIC_EXCHANGE_KEYS_FAILURE)))); ekr_finished (ekr); return; } TALER_payto_hash (ekr->payto_uri, &h_payto); ekr->kyc = TALER_EXCHANGE_kyc_check ( - eh, + merchant_curl_ctx, + ekr->exchange_url, + keys, ekr->exchange_kyc_serial, &h_payto, ekr->kc->mi->settings.ut, @@ -748,8 +737,7 @@ kyc_status_cb (void *cls, ekr->payto_uri = GNUNET_strdup (payto_uri); ekr->last_check = last_check; ekr->kc = kc; - ekr->fo = TMH_EXCHANGES_find_exchange (exchange_url, - false, + ekr->fo = TMH_EXCHANGES_keys4exchange (exchange_url, &kyc_with_exchange, ekr); } |