Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Users KYC status not REGULAR after KYC Success hook call #237

Open
felixhagspiel opened this issue Mar 23, 2021 · 4 comments
Open

Users KYC status not REGULAR after KYC Success hook call #237

felixhagspiel opened this issue Mar 23, 2021 · 4 comments

Comments

@felixhagspiel
Copy link

Issue:

We receive a hook call for they KYC success, and when we pull the user via the API the status in the response is still "LIGHT". This does not happen often, but sometimes. We then have to call our hook ourself to solve this. This has only happened for individuals so far, not with business users.

What we are currently doing:

  1. You call our USER_KYC_REGULAR Hook
  2. we receive the hook call
  3. we pull the user from your system via the users-endpoint
  4. we check that the user has the status REGULAR <- This is where we sometimes get a failed message from our servers, because the KYC level was not „REGULAR“ but still something else (i.e. "LIGHT").

What the problem could be:

We had a similar issue on our servers before, as we are using own webhooks as well. Let me describe what I expect the issue to be:

  1. User has uploaded all documents and they are accepted
  2. Mangopay Backend now calls a function to update the users status in the database
  3. The function is opening up a new database transaction for the update
  4. Function is updating the users entity to „REGULAR“ but is not yet committing the transaction
  5. You are calling our hook
  6. Function is finished and database transaction is submitted, user has now status REGULAR in database
  7. We call your API (right after the hook call in 5) and we will get the user with KYC level "REGULAR", all good

This will work for in most cases, but when there are a lot of simultan requests to your API, your database transaction might need a few milliseconds longer, and this can result in us pulling outdated data from your API, as the call is asynchronous.
This would also explain why this is only happening sometimes.

Our solution was to send a promise to the database transaction that calls the hook only after the database transaction has been completed.

Of course this could also be an issue on your Identification Providers side.

Please let me know if you need further details.

@fredericdelordm
Copy link

Hello @felixhagspiel,

We are currently looking at this with the team in charge of KYC Documents and related hooks. We will get back to you ASAP.

Have a nice day,

@felixhagspiel
Copy link
Author

Hello @fredericdelordm this just happened again. Any news on this?

@fredericdelordm
Copy link

@felixhagspiel we are still investigating your issue and will get back to you soon

@BigWenceslas
Copy link

Hello, Issue with web hooks are still presents...

Issue:

We receive a hook call for they KYC success, and when we pull the user via the API the status in the response is still "LIGHT". This does not happen often, but sometimes. We then have to call our hook ourself to solve this. This has only happened for individuals so far, not with business users.

What we are currently doing:

  1. You call our USER_KYC_REGULAR Hook
  2. we receive the hook call
  3. we pull the user from your system via the users-endpoint
  4. we check that the user has the status REGULAR <- This is where we sometimes get a failed message from our servers, because the KYC level was not „REGULAR“ but still something else (i.e. "LIGHT").

What the problem could be:

We had a similar issue on our servers before, as we are using own webhooks as well. Let me describe what I expect the issue to be:

  1. User has uploaded all documents and they are accepted
  2. Mangopay Backend now calls a function to update the users status in the database
  3. The function is opening up a new database transaction for the update
  4. Function is updating the users entity to „REGULAR“ but is not yet committing the transaction
  5. You are calling our hook
  6. Function is finished and database transaction is submitted, user has now status REGULAR in database
  7. We call your API (right after the hook call in 5) and we will get the user with KYC level "REGULAR", all good

This will work for in most cases, but when there are a lot of simultan requests to your API, your database transaction might need a few milliseconds longer, and this can result in us pulling outdated data from your API, as the call is asynchronous. This would also explain why this is only happening sometimes.

Our solution was to send a promise to the database transaction that calls the hook only after the database transaction has been completed.

Of course this could also be an issue on your Identification Providers side.

Please let me know if you need further details.

I have the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants