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: return appropriate error message during webhook call for invalid merchant_secret adyen #2450

Merged

Conversation

hrithikesh026
Copy link
Contributor

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Currently adyen returns bad request body error during webhook call if merchant_secret set by the merchant for webhook source verification is invalid.

In this PR, appropriate error message will be returned when merchant_secret is an invalid value.

{"error":{"type":"invalid_request","message":"Merchant Secret set for webhook source verificartion is invalid","code":"WE_02"}}

hex::decode(string) function is used to decode the merchant_secret to a Vec<u8> in adyen.
This hex::decode(string) function will return Err() if the string value passed to it either has odd number of characters or if it has an invalid character.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Manual
Screenshot 2023-10-04 at 7 50 10 PM

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@hrithikesh026 hrithikesh026 added A-core Area: Core flows C-bug Category: Bug S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Oct 4, 2023
@hrithikesh026 hrithikesh026 added this to the September 2023 Milestone milestone Oct 4, 2023
@hrithikesh026 hrithikesh026 requested review from a team as code owners October 4, 2023 14:36
@hrithikesh026 hrithikesh026 self-assigned this Oct 4, 2023
@jarnura jarnura added this pull request to the merge queue Oct 5, 2023
Merged via the queue into main with commit db7f9fa Oct 5, 2023
10 checks passed
@jarnura jarnura deleted the fix-adyen-webhook-error-message-for-invalid-merchant-secret branch October 5, 2023 09:59
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants