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(analytics): Add v2 payment analytics (payment-intents analytics) #5150

Merged
merged 9 commits into from
Jul 1, 2024

Conversation

tsdk02
Copy link
Contributor

@tsdk02 tsdk02 commented Jun 27, 2024

Type of Change

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

Description

Added analytics based on payment intent

Currently supporting 4 metrics

  • successful smart retries
  • total smart retries
  • smart retried amount
  • payment intent count

filters

  • status
  • currency

group by

  • status
  • currency

Additional Changes

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

Motivation and Context

Utilizing payment intents aligns closely with the data needs of merchants, enhancing their ability to manage and process transactions more effectively.

How did you test it?

Tested using local data by sending cURL requests through Postman.
Tested using Postgres data from payment_intents table and also using Clickhouse data from payment_intent table.
Screenshot 2024-06-28 at 12 33 21 PM
Screenshot 2024-06-28 at 12 35 44 PM
Screenshot 2024-06-28 at 12 36 05 PM

Screenshot 2024-06-28 at 12 33 38 PM

Screenshot 2024-06-28 at 12 37 02 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

@tsdk02 tsdk02 self-assigned this Jun 27, 2024
@tsdk02 tsdk02 requested a review from a team as a code owner June 27, 2024 19:38
@tsdk02 tsdk02 linked an issue Jun 27, 2024 that may be closed by this pull request
@tsdk02 tsdk02 requested review from lsampras and ivor11 June 27, 2024 20:29
.add_custom_filter_clause("attempt_count", "1", FilterTypes::Gt)
.switch()?;
query_builder
.add_custom_filter_clause("status", "succeeded", FilterTypes::Equal)
Copy link
Contributor

Choose a reason for hiding this comment

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

can you use the payment intent success type here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

alias: Some("end_bucket"),
})
.switch()?;

Copy link
Contributor

Choose a reason for hiding this comment

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

is status = succeeded filter required here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes added it

.switch()?;

filters.set_filter_clause(&mut query_builder).switch()?;

Copy link
Contributor

Choose a reason for hiding this comment

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

and this

Suggested change
query_builder
.add_custom_filter_clause("attempt_count", "1", FilterTypes::Gt)
.switch()?;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this

@tsdk02 tsdk02 requested a review from Abhitator216 July 1, 2024 09:18
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Jul 1, 2024
Merged via the queue into main with commit 9fc525d Jul 1, 2024
11 checks passed
@Gnanasundari24 Gnanasundari24 deleted the payment-intent-analytics branch July 1, 2024 12:31
pixincreate added a commit that referenced this pull request Jul 2, 2024
…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)
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.

feat(analytics): Add v2 payment analytics
5 participants