-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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(connector): [Paypal] dispute webhook deserialization failure #5111
Conversation
1456f86
to
61e32de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hii @KiranKBR ,
- Please add a proper title and description for this PR.
- Please attach all the test cases and db screenshots.
c39d939
to
caa2eaf
Compare
8b15b40
to
27144e2
Compare
.first() | ||
.map(|transaction| transaction.reference_id.clone()) | ||
.map(|transaction| transaction.seller_transaction_id.clone()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If seller_transaction_id
is not our id, we should change PaymentIdType to ConnectorTransactionId instead of PaymentAttemptId
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be seller_transaction_id
| PaypalWebhookEventType::CustomerDisputeResolved | ||
| PaypalWebhookEventType::CustomerDisputedUpdated | ||
| PaypalWebhookEventType::RiskDisputeCreated => Some( | ||
PaypalWebhookEventType::CustomerDisputeResolved => Some( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check the outcome code for all the Dispute events right, why is this change required here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They r sending outcome_code for resolved events only
transformers::PaypalResource::PaypalCardWebhooks(_) | ||
| transformers::PaypalResource::PaypalRedirectsWebhooks(_) | ||
| transformers::PaypalResource::PaypalRefundWebhooks(_) => { | ||
Err(errors::ConnectorError::WebhookResourceObjectNotFound.into()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of throwing Badrequest (4xx) here, can we make it as a 5xx?
43c50ef
to
39c1616
Compare
66e5d44
to
ee94324
Compare
PaypalWebhookEventType::PaymentAuthorizationCreated | ||
PaypalWebhookEventType::CustomerDisputeCreated | ||
| PaypalWebhookEventType::RiskDisputeCreated | ||
| PaypalWebhookEventType::CustomerDisputedUpdated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, we should get outcome_code for CustomerDisputedUpdated to identify the event. Can we please check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked, we are not getting outcome_code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please share the sample payload for CustomerDisputedUpdated event?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have shared u via slack
transformers::PaypalResource::PaypalCardWebhooks(_) | ||
| transformers::PaypalResource::PaypalRedirectsWebhooks(_) | ||
| transformers::PaypalResource::PaypalRefundWebhooks(_) => { | ||
Err(errors::ConnectorError::ResponseDeserializationFailed.into()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have an attach_printable here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
b1eef65
to
e9a39d8
Compare
…ror-handling-in-cypress * 'main' of github.com:juspay/hyperswitch: fix(auth_methods): Add checks for duplicate `auth_method` in create API (#5161) chore(version): 2024.07.02.0 fix(router): rename the browser name header to `x-browser-name` (#5162) fix(router): mark retry payment as failure if `connector_tokenization` fails (#5114) fix(connector): [Paypal] dispute webhook deserialization failure (#5111) feat(analytics): Add v2 payment analytics (payment-intents analytics) (#5150) feat(globalsearch): Implement tag-based filters in global search (#5151) refactor(connector): Add amount conversion framework to iatapay along with amount conversion code to connector template (#4866) feat(payment_link): add multiple custom css support in business level (#5137) feat(connector): [Bambora Apac] Template for integration (#5062) feat(tls): add support for https in actix web (#5089) chore(ci): fix ci tests failing by removing them (#5167) chore(version): 2024.07.01.0 chore(postman): update Postman collection files ci(postman): log request id for user tests (#5159) chore(euclid_wasm): make field domain optional wasm (#5154)
Type of Change
Description
This refactored branch resolves the PayPal dispute webhook deserialization issue.
-> It was failing to identify the webhook entity type and object reference ID.
-> I updated the fields accordingly to resolve the deserialization issue.
Additional Changes
Motivation and Context
Motivation #5069
there are some filed refactors included which resolved the problem
How did you test it?
I ran the ngrok for frowarding webhook payload to localhost with url (https://697b-219-65-110-2.ngrok-free.app/webhooks/merchant_1719300138/paypal)
I have created dispute webhook through paypal simulator and these are the logs :
Incoming webhook Payload:
Dispute Creation:
Source Verification:
Due to these are Mock events , we cant verify them through Paypal so I have done source verification as true to check further flows like Database record creation and triggering outgoing webhooks.
Database Record Creation:
Outgoing Webhook Response Payload:
Checklist
cargo +nightly fmt --all
cargo clippy