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(core): add new payments webhook events #3212

Merged
merged 8 commits into from
Jan 10, 2024

Conversation

hrithikesh026
Copy link
Contributor

@hrithikesh026 hrithikesh026 commented Dec 28, 2023

Type of Change

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

Description

Added support for below Incoming webhooks


 PaymentIntentCancelFailure,
    PaymentIntentAuthorizationSuccess,
    PaymentIntentAuthorizationFailure,
    PaymentIntentCaptureSuccess,
    PaymentIntentCaptureFailure,

Also added support for below outgoing webhooks.

PaymentAuthorized
PaymentCaptured

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?

This PR cannot be tested unless connector changes are done.
This PR only has core changes.
Can be tested after this PR gets merged. #3298

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 C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Dec 28, 2023
@hrithikesh026 hrithikesh026 added this to the December 2023 Release milestone Dec 28, 2023
@hrithikesh026 hrithikesh026 self-assigned this Dec 28, 2023
@hrithikesh026 hrithikesh026 requested review from a team as code owners December 28, 2023 07:08
ArjunKarthik
ArjunKarthik previously approved these changes Jan 9, 2024
jarnura
jarnura previously approved these changes Jan 9, 2024
Co-authored-by: hrithikeshvm <vmhrithikesh@gmail.com>
@hrithikesh026 hrithikesh026 dismissed stale reviews from jarnura and ArjunKarthik via 7457f74 January 9, 2024 14:52
@hrithikesh026 hrithikesh026 requested review from a team as code owners January 9, 2024 14:52
@@ -1956,6 +1956,9 @@ impl api::IncomingWebhook for Stripe {
stripe::WebhookEventType::PaymentIntentCanceled => {
api::IncomingWebhookEvent::PaymentIntentCancelled
}
stripe::WebhookEventType::PaymentIntentAmountCapturableUpdated => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't PaymentIntentAuthorizationSuccess meant for Authorized payments?

But as per stripe docs PaymentIntentAmountCapturableUpdated "Occurs when a PaymentIntent has funds to be captured. Check the amount_capturable property on the PaymentIntent to determine the amount that can be captured. You may capture the PaymentIntent with an amount_to_capture value up to the specified amount"

Ref - https://stripe.com/docs/api/events/types

Copy link
Contributor Author

Choose a reason for hiding this comment

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

amount_capturable ideally will be updated only when authorization succeeds.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@ArjunKarthik ArjunKarthik left a comment

Choose a reason for hiding this comment

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

LGTM

@likhinbopanna likhinbopanna added this pull request to the merge queue Jan 10, 2024
Merged via the queue into main with commit e0e28b8 Jan 10, 2024
9 of 11 checks passed
@likhinbopanna likhinbopanna deleted the add-new-incoming-webhook-events branch January 10, 2024 13:42
pixincreate added a commit that referenced this pull request Jan 11, 2024
* 'main' of github.com:juspay/hyperswitch:
  ci: use git commands for pushing commits and tags in nightly release workflows (#3314)
  refactor(connector): [bluesnap] add connector_txn_id fallback for webhook (#3315)
  feat(core): add new payments webhook events (#3212)
  chore: nits and small code improvements found during investigation of PR#3168 (#3259)
  refactor: removed basilisk feature (#3281)
  fix(euclid_wasm): Update braintree config prod (#3288)
  feat(payment_link): add status page for payment link (#3213)
  chore(version): 2024.01.10.0
  chore(postman): update Postman collection files
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants