aboutsummaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-08-11 23:35:57 +0200
committerChristian Grothoff <christian@grothoff.org>2022-08-11 23:35:57 +0200
commit1b751d3f8c6bb7efd9b4acd54b4a1bf5266043bf (patch)
tree8855c2d979f8f273254d8e593cf364c19c73a9f3 /src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c
parent7aec7a252f2ac6ae677b9fa48c831963ab719582 (diff)
-fix handling of serialization failure
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.c23
1 files changed, 23 insertions, 0 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 fbb4f63f..d3f32da2 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
@@ -114,6 +114,7 @@ struct ExchangeKycRequest
* Last KYC status returned by the exchange.
*/
bool kyc_ok;
+
};
@@ -217,6 +218,13 @@ struct KycContext
* True if @e h_wire was given.
*/
bool have_h_wire;
+
+ /**
+ * We're still waiting on the exchange to determine
+ * the KYC status of our deposit(s).
+ */
+ bool kyc_serial_pending;
+
};
@@ -615,6 +623,11 @@ kyc_status_cb (void *cls,
<,
STALE_KYC_TIMEOUT)) )
return; /* KYC ok, ignore! */
+ if (0 == exchange_kyc_serial)
+ {
+ kc->kyc_serial_pending = true;
+ return;
+ }
kc->response_code = MHD_HTTP_ACCEPTED;
ekr = GNUNET_new (struct ExchangeKycRequest);
GNUNET_CONTAINER_DLL_insert (kc->exchange_pending_head,
@@ -766,6 +779,16 @@ get_instances_ID_kyc (struct TMH_MerchantInstance *mi,
"account_kyc_get_status");
}
}
+ if (kc->kyc_serial_pending)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Exchange legitimization UUID unknown, assuming KYC pending\n");
+ return TALER_MHD_REPLY_JSON_PACK (
+ connection,
+ MHD_HTTP_SERVICE_UNAVAILABLE,
+ GNUNET_JSON_pack_string ("hint",
+ "awaiting legitimization UUID"));
+ }
if (NULL == kc->exchange_pending_head)
return TALER_MHD_reply_static (connection,
MHD_HTTP_NO_CONTENT,