aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-07-30 23:31:02 +0200
committerChristian Grothoff <christian@grothoff.org>2024-07-30 23:31:02 +0200
commit01fa3466e15d70cbd1e4719843ae39eff07eb229 (patch)
tree77f02e07d1eda741cd593fe1af597769b8ef1eac /src/backend
parent195971f7dac9820a8fdd68ec574d1a99d6f7343b (diff)
fix FTBFS when compiling against exchange v0.13 API
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/taler-merchant-depositcheck.c12
-rw-r--r--src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c77
-rw-r--r--src/backend/taler-merchant-httpd_private-get-pos.c2
3 files changed, 25 insertions, 66 deletions
diff --git a/src/backend/taler-merchant-depositcheck.c b/src/backend/taler-merchant-depositcheck.c
index 9245e1fb..cd0242f0 100644
--- a/src/backend/taler-merchant-depositcheck.c
+++ b/src/backend/taler-merchant-depositcheck.c
@@ -457,9 +457,8 @@ deposit_get_cb (void *cls,
struct GNUNET_TIME_Timestamp now;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Exchange returned KYC requirement (%d/%d) for deposited coin %s\n",
+ "Exchange returned KYC requirement (%d) for deposited coin %s\n",
dr->details.accepted.kyc_ok,
- dr->details.accepted.aml_decision,
TALER_B2S (&w->coin_pub));
now = GNUNET_TIME_timestamp_get ();
qs = db_plugin->account_kyc_set_status (
@@ -468,20 +467,15 @@ deposit_get_cb (void *cls,
&w->h_wire,
exchange_url,
dr->details.accepted.requirement_row,
- NULL,
- NULL,
now,
- dr->details.accepted.kyc_ok,
- dr->details.accepted.aml_decision);
+ dr->details.accepted.kyc_ok);
if (qs < 0)
{
GNUNET_break (0);
GNUNET_SCHEDULER_shutdown ();
return;
}
- if (dr->details.accepted.kyc_ok &&
- (TALER_AML_NORMAL ==
- dr->details.accepted.aml_decision))
+ if (dr->details.accepted.kyc_ok)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Bumping wire transfer deadline in DB to %s as that is when we will retry\n",
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),
<,
diff --git a/src/backend/taler-merchant-httpd_private-get-pos.c b/src/backend/taler-merchant-httpd_private-get-pos.c
index d1230243..1595d3a2 100644
--- a/src/backend/taler-merchant-httpd_private-get-pos.c
+++ b/src/backend/taler-merchant-httpd_private-get-pos.c
@@ -20,7 +20,7 @@
*/
#include "platform.h"
#include "taler-merchant-httpd_private-get-pos.h"
-
+#include <taler/taler_json_lib.h>
/**
* Closure for add_product().