summaryrefslogtreecommitdiff
path: root/src/kyclogic/plugin_kyclogic_kycaid.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-01-28 17:08:51 +0100
committerChristian Grothoff <christian@grothoff.org>2023-01-28 17:08:51 +0100
commit92f16aad515cd15834ece7bad4d526d38dd3e4fb (patch)
treeb6e5950ea805675b55851605ee3a13135b05eddb /src/kyclogic/plugin_kyclogic_kycaid.c
parent2aff69e7ec687c60a056f7d577cf95b66030ac0f (diff)
downloadexchange-92f16aad515cd15834ece7bad4d526d38dd3e4fb.tar.gz
exchange-92f16aad515cd15834ece7bad4d526d38dd3e4fb.tar.bz2
exchange-92f16aad515cd15834ece7bad4d526d38dd3e4fb.zip
-misc fixes
Diffstat (limited to 'src/kyclogic/plugin_kyclogic_kycaid.c')
-rw-r--r--src/kyclogic/plugin_kyclogic_kycaid.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/kyclogic/plugin_kyclogic_kycaid.c b/src/kyclogic/plugin_kyclogic_kycaid.c
index 9d0bc5262..6ea1740e1 100644
--- a/src/kyclogic/plugin_kyclogic_kycaid.c
+++ b/src/kyclogic/plugin_kyclogic_kycaid.c
@@ -1193,6 +1193,7 @@ async_webhook_reply (void *cls)
{
struct TALER_KYCLOGIC_WebhookHandle *wh = cls;
+ wh->task = NULL;
wh->cb (wh->cb_cls,
wh->process_row,
(0 == wh->process_row)
@@ -1248,9 +1249,10 @@ kycaid_webhook (void *cls,
const char *type;
const char *verification_id;
const char *applicant_id;
- const char *status;
- bool verified;
- json_t *verifications;
+ const char *status = NULL;
+ bool verified = false;
+ bool no_verified = true;
+ json_t *verifications = NULL;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_string ("request_id",
&request_id),
@@ -1260,12 +1262,18 @@ kycaid_webhook (void *cls,
&verification_id),
GNUNET_JSON_spec_string ("applicant_id",
&applicant_id),
- GNUNET_JSON_spec_string ("status",
- &status),
- GNUNET_JSON_spec_bool ("verified",
- &verified),
- GNUNET_JSON_spec_json ("verifications",
- &verifications),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_string ("status",
+ &status),
+ NULL),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_bool ("verified",
+ &verified),
+ &no_verified),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_json ("verifications",
+ &verifications),
+ NULL),
GNUNET_JSON_spec_end ()
};
enum GNUNET_DB_QueryStatus qs;
@@ -1340,7 +1348,10 @@ kycaid_webhook (void *cls,
}
wh->verification_id = GNUNET_strdup (verification_id);
wh->applicant_id = GNUNET_strdup (applicant_id);
- if (! verified)
+ if ( (0 != strcasecmp (type,
+ "VERIFICATION_COMPLETED")) ||
+ (no_verified) ||
+ (! verified) )
{
/* We don't need to re-confirm the failure by
asking the API again. */