feat(core): allow setting up status across payments, refunds and payouts for triggering webhooks in core resource flows#8433
Merged
likhinbopanna merged 6 commits intomainfrom Jun 30, 2025
Conversation
…uts for triggering webhooks in core resource flows
2 tasks
jarnura
requested changes
Jun 23, 2025
Member
jarnura
left a comment
There was a problem hiding this comment.
Is this change causes any issues in v2, the checks are failing for v2
Contributor
Author
This was due to missing feature dependency in |
jarnura
approved these changes
Jun 26, 2025
prajjwalkumar17
approved these changes
Jun 27, 2025
maverox
pushed a commit
that referenced
this pull request
Jul 8, 2025
…uts for triggering webhooks in core resource flows (#8433) Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
This pull request introduces validation for webhook status configurations at the business profile level.
Specifically, the following changes have been made:
WebhookDetails Validation:
validate()method to theWebhookDetailsstruct incrates/api_models/src/admin.rs.payment_statuses_enabled,refund_statuses_enabled, andpayout_statuses_enabledare valid and correspond to triggerable event types.API Handler Integration:
crates/router/src/routes/profiles.rsfor merchant account creation, merchant account updates, profile creation and profile updates.WebhookDetails::validate()method ifwebhook_detailsare present in the request payload.ApiErrorResponse::InvalidRequestDatawith a descriptive message.Core flows - payments, refunds and payouts
WASM functionalities
This ensures that only valid webhook configurations are accepted and stored, improving the robustness of the outgoing webhook system.
Additional Changes
Motivation and Context
Allows merchants to configure different statuses for triggering outgoing webhooks.
How did you test it?
I. New behavior
1. Create Merchant Account with custom `webhook_details`
cURL
Response
Expectation
2. Create a payment
cURL
Response
Expectation
requires_capturewhich was configured for triggering webhooks3. Update an existing profile
cURL
Response
Expectation
II. Existing behavior
1. Create Merchant account without specifying custom status list for triggering webhooks
cURL
Response
2. Create a payment
cURL
Response
Expectation
requires_captureis not configured for triggering webhooks by defaultChecklist
cargo +nightly fmt --allcargo clippy