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

fix(adyen): Improve webhook handling with missing code #2714

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

vincent-pochet
Copy link
Collaborator

Context

This PR is related to the BaseService::ServiceFailure - payment_provider_code_missing: Code is missing raised by the WebhooksController#adyen endpoint.

The API is raising a lot of these error that are related to a wrong configuration of the Adyen webhook URL.
When an organization has multiple Adyen account configured, the webhook call must contain a code parameter. When this value is missing the call just end with an HTTP 500 error.

Description

Since nothing can be do to remediate the situation on Lago's side and it is generating a lot of noise, this PR handle this kind of error to keep notifying Adyen that the webhook was not succesfully handled (Bad Request response) but is avoiding the HTTP 500 error and the related Sentry issue

List any dependencies that are required.

@vincent-pochet vincent-pochet force-pushed the fix-adyen-webhook-support branch from 4694919 to 1afada1 Compare October 18, 2024 14:08
Copy link
Contributor

@annvelents annvelents left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I would only maybe add a test on this change of the error code when handling payment_provider_failure from payment_provider_code_missing to webhook_error

@vincent-pochet vincent-pochet force-pushed the fix-adyen-webhook-support branch from 1afada1 to bd02b71 Compare October 18, 2024 14:38
@vincent-pochet vincent-pochet merged commit 30117ee into main Oct 18, 2024
6 checks passed
@vincent-pochet vincent-pochet deleted the fix-adyen-webhook-support branch October 18, 2024 14:49
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

Successfully merging this pull request may close these issues.

2 participants