Skip to content

Conversation

srujanchikke
Copy link
Contributor

@srujanchikke srujanchikke commented Oct 17, 2023

Type of Change

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

Description

fix error deserelization for source verification call . Make description in error response as optional field as it is not expected incase of webhook source verification call

Additional Changes

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

Motivation and Context

fix error deserelization for source verification call . Make description in error response as optional field as it is not expected incase of webhook source verification call

How did you test it?

1)error deserilization success scenario ,
Source verifcation is failure as secret is not set in merchant connector account ,By default we provide secret as default_string. when we include _ in webhook secret paypal throws error as follow
"name": "INVALID_REQUEST", "message": "Request is not well-formed, syntactically incorrect, or violates schema.", "debug_id": "c2a4be266f6d6", "details": [ { "field": "/webhook_id", "value": "sruj*an", "location": "body", "issue": "must match \"^[a-zA-Z0-9]+$\"" } ],
Screenshot 2023-10-17 at 2 59 40 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

@srujanchikke srujanchikke added A-connector-integration Area: Connector integration C-bug Category: Bug S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Oct 17, 2023
@srujanchikke srujanchikke self-assigned this Oct 17, 2023
@srujanchikke srujanchikke requested a review from a team as a code owner October 17, 2023 09:58
Comment on lines 192 to 198
let reason = match error_reason {
Some(err_reason) => err_reason
.is_empty()
.then(|| response.message.to_owned())
.or(Some(err_reason)),
None => Some(response.message.to_owned()),
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let reason = match error_reason {
Some(err_reason) => err_reason
.is_empty()
.then(|| response.message.to_owned())
.or(Some(err_reason)),
None => Some(response.message.to_owned()),
};
let reason = error_reason
.unwrap_or(response.message.to_owned())
.is_empty()
.then_some(response.message.to_owned());

@ArjunKarthik ArjunKarthik added the S-waiting-on-author Status: This PR is incomplete or needs to address review comments label Oct 17, 2023
@ArjunKarthik ArjunKarthik added S-waiting-on-approval Status: Review completed, awaiting for approvals from code-owners and removed S-waiting-on-author Status: This PR is incomplete or needs to address review comments labels Oct 18, 2023
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Oct 18, 2023
Merged via the queue into main with commit da77d13 Oct 18, 2023
@Gnanasundari24 Gnanasundari24 deleted the paypal_webhook_fix branch October 18, 2023 08:41
@ArjunKarthik ArjunKarthik removed S-waiting-on-approval Status: Review completed, awaiting for approvals from code-owners S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-integration Area: Connector integration C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants