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

feat(events): Add payment reject audit events #6465

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

AnishKacham
Copy link
Contributor

@AnishKacham AnishKacham commented Oct 29, 2024

Type of Change

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

Description

Pass along request_state to payment_core
Modify the UpdateTracker trait to accept request state
Modify the PaymentReject implementation of UpdateTracker to generate an event

Additional Changes

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

Files changed

  1. crates/router/src/core/payments/operations/payment_reject.rs
  2. crates/router/src/events/audit_events.rs

Motivation and Context

Resolves #4669

How did you test it?

This requires FRM related flows to be tested, and may not be tested locally.

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

@AnishKacham AnishKacham requested review from a team as code owners October 29, 2024 18:10
Copy link

semanticdiff-com bot commented Oct 29, 2024

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/core/payments/operations/payment_reject.rs  0% smaller
  crates/router/src/events/audit_events.rs  0% smaller

@tsdk02
Copy link
Contributor

tsdk02 commented Oct 30, 2024

Hey @AnishKacham ,
Can you share the event json or a screenshot of the event,
Can refer to pr #4166 for reference.

For the UI in the screenshot, you can find the docs to set up Kafka, kafka-ui (the interface in the screenshot) and ClickHouse using Docker Compose here: https://github.com/juspay/hyperswitch/tree/main/crates/analytics/docs

and then try generating said events and monitor logs in kafka-ui.

Also the docs are self-explanatory but still if in any doubt ping us in this slack channel

@gorakhnathy7 gorakhnathy7 added the hacktoberfest Issues that are up for grabs for Hacktoberfest participants label Oct 30, 2024
@AnishKacham
Copy link
Contributor Author

Hey @tsdk02 , I have everything setup for viewing the audit events. But I'm unsure of how to generate them. I've asked on the slack channel as well. Which endpoint do I hit from postman? I checked the hyper switch api reference buy did not find anything specific to "PaymentReject"

@gorakhnathy7 gorakhnathy7 added the hacktoberfest-accepted Pull requests accepted as Hacktoberfest contributions label Oct 31, 2024
@tsdk02
Copy link
Contributor

tsdk02 commented Nov 4, 2024

Hey @AnishKacham, I have confirmed with the concerned team, and PaymentReject is an internal operation and it cannot be tested independently.
Please make the above changes and your PR will be good to go.

@gorakhnathy7 gorakhnathy7 requested review from sai-harsha-vardhan and removed request for lsampras and maverox November 5, 2024 06:11
@AnishKacham
Copy link
Contributor Author

Hey @AnishKacham, I have confirmed with the concerned team, and PaymentReject is an internal operation and it cannot be tested independently. Please make the above changes and your PR will be good to go.

I'll make the changes

@tsdk02
Copy link
Contributor

tsdk02 commented Nov 6, 2024

Hey @AnishKacham, a gentle reminder to add the changes to this PR, so it can be merged

@AnishKacham AnishKacham force-pushed the audit-events-payment-reject branch from ca7fe0d to 43cf2b5 Compare November 6, 2024 18:09
@AnishKacham
Copy link
Contributor Author

Hey @AnishKacham, a gentle reminder to add the changes to this PR, so it can be merged

Done. Let me know if something needs to be addressed.

@AnishKacham AnishKacham force-pushed the audit-events-payment-reject branch from 43cf2b5 to c2eb699 Compare November 7, 2024 04:12
@gorakhnathy7 gorakhnathy7 requested a review from tsdk02 November 7, 2024 07:01
tsdk02
tsdk02 previously approved these changes Nov 7, 2024
Chethan-rao
Chethan-rao previously approved these changes Nov 7, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Nov 7, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Nov 7, 2024
@AnishKacham AnishKacham dismissed stale reviews from Chethan-rao and tsdk02 via a69ea2f November 7, 2024 16:29
@AnishKacham AnishKacham force-pushed the audit-events-payment-reject branch from c2eb699 to a69ea2f Compare November 7, 2024 16:29
@AnishKacham
Copy link
Contributor Author

Rebased because of merge conflicts

@AnishKacham AnishKacham force-pushed the audit-events-payment-reject branch from a69ea2f to 4cc668b Compare November 8, 2024 17:10
@likhinbopanna likhinbopanna added this pull request to the merge queue Nov 12, 2024
Merged via the queue into juspay:main with commit 6b029ab Nov 12, 2024
17 checks passed
bsayak03 pushed a commit that referenced this pull request Nov 26, 2024
Co-authored-by: Anish Kacham <f2010091@hyderabad.bits-pilani.ac.in>
bsayak03 pushed a commit that referenced this pull request Nov 26, 2024
Co-authored-by: Anish Kacham <f2010091@hyderabad.bits-pilani.ac.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Issues that are up for grabs for Hacktoberfest participants hacktoberfest-accepted Pull requests accepted as Hacktoberfest contributions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding events for Payment Reject
5 participants