-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(payouts): add domain type for PayoutId #8395
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
Merged
Merged
Conversation
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
feat(payouts): allow payout_id to be configurable in API request feat(payouts): add merchant_order_reference_id for referencing payouts
2 tasks
crates/hyperswitch_connectors/src/connectors/wise/transformers.rs
Outdated
Show resolved
Hide resolved
jarnura
requested changes
Jun 26, 2025
su-shivanshmathur
previously approved these changes
Jun 30, 2025
Sarthak1799
previously approved these changes
Jun 30, 2025
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.
Routing file changes looks okay
jarnura
requested changes
Jun 30, 2025
crates/hyperswitch_connectors/src/connectors/wise/transformers.rs
Outdated
Show resolved
Hide resolved
1a2a3f2
jarnura
previously approved these changes
Jul 1, 2025
jarnura
previously approved these changes
Jul 1, 2025
su-shivanshmathur
previously approved these changes
Jul 1, 2025
…to-be-configurable
su-shivanshmathur
approved these changes
Jul 1, 2025
jarnura
approved these changes
Jul 1, 2025
Sarthak1799
approved these changes
Jul 1, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
M-api-contract-changes
Metadata: This PR involves API contract changes
M-database-changes
Metadata: This PR involves database schema changes
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.
feat(payouts): allow payout_id to be configurable in API request
feat(payouts): add merchant_order_reference_id for referencing payouts
Type of Change
Description
This pull request introduces two main features for payouts:
Configurable
payout_id
in API Requests:payout_id
field in payout creation API requests can now be optionally provided by the merchant. If provided, this ID will be used for the payout. If not provided, the system will generate one.payout_id
has been standardized to use the strongly-typedcommon_utils::id_type::PayoutId
instead ofString
. This change has been propagated throughout relevant structs and functionalities likePayoutsData
, data handling logic incrates/router/src/core/utils.rs
, test utilities and DB queries.merchant_order_reference_id
for Payout Referencing:merchant_order_reference_id
field has been added/updated in payout API models (e.g.,PayoutListFilterConstraints
incrates/api_models/src/payouts.rs
). This allows merchants to use their own unique identifier to reference payouts.Refactoring and Connector Updates:
id_type::PayoutId
change and ensure correct data flow, connector integrations (Adyen, Adyenplatform, Cybersource, Nomupay) have been refactored.RouterData.connector_request_reference_id
(which typically holds thepayout_attempt_id
as aString
) when a string-based reference is required by the external service, rather than converting the internalPayoutsData.payout_id
. This ensures that connectors receive the appropriate string identifier (e.g.,payout_attempt_id
) they expect.Additional Changes
Motivation and Context
These changes address the need for greater flexibility and type safety in payout processing, as outlined in GitHub issues #8392 and #1321.
payout_id
: Allows merchants more control over their payout identifiers within the Hyperswitch.merchant_order_reference_id
: Provides a dedicated field for merchants to use their internal order or reference IDs.PayoutId
Type Standardization: Usingcommon_utils::id_type::PayoutId
enhances code robustness and maintainability by leveraging Rust's type system to prevent errors related to ID handling.payout_attempt_id
viaconnector_request_reference_id
) required by external payout processors, maintaining correctness of integrations.Links to issues:
How did you test it?
1. Card payouts via API
cURL
Response
2. Card payouts via Payout Links
cURL
Response
Checklist
cargo +nightly fmt --all
cargo clippy