feat(router): Add v2 endpoint to list payment attempts by intent_id#8368
feat(router): Add v2 endpoint to list payment attempts by intent_id#8368likhinbopanna merged 7 commits intomainfrom
Conversation
Changed Files
|
crates/hyperswitch_domain_models/src/router_flow_types/payments.rs
Outdated
Show resolved
Hide resolved
|
We need add get attempt list fetch in revenue recovery incoming webhooks flow instead of fetching attempt list via payment get. |
| web::resource("/confirm-intent") | ||
| .route(web::post().to(payments::payment_confirm_intent)), | ||
| ) | ||
| .service( |
There was a problem hiding this comment.
Please generate open-api spec for this endpoint and validate it.
There was a problem hiding this comment.
Nit: If you want the endpoint included in the API reference, then you'd have to update the Mintlify docs / config file as well.
54bffa9
SanchithHegde
left a comment
There was a problem hiding this comment.
Other than that, looks good to me!
| } | ||
| #[cfg(feature = "v2")] | ||
| #[derive(Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema)] | ||
| pub struct PaymentAttemptListRequest { |
There was a problem hiding this comment.
Nit: Would appreciate documentation comments being added.
| #[cfg(feature = "v2")] | ||
| pub mod payment_update_intent; | ||
| #[cfg(feature = "v2")] | ||
| pub mod proxy_payments_intent; |
There was a problem hiding this comment.
Nit: We should consider renaming the module to be proxy_payment_intent instead (not payments intent).
| web::resource("/confirm-intent") | ||
| .route(web::post().to(payments::payment_confirm_intent)), | ||
| ) | ||
| .service( |
There was a problem hiding this comment.
Nit: If you want the endpoint included in the API reference, then you'd have to update the Mintlify docs / config file as well.
| /// Payments create and confirm intent flow | ||
| PaymentsCreateAndConfirmIntent, | ||
| /// Payment attempt list flow | ||
| PaymentAttemptsList, |
There was a problem hiding this comment.
Nit: We might want to consider naming this as PaymentsAttemptsList, to maintain consistency with the other payments related enum variants.
…8368) Co-authored-by: Aniket Burman <aniket.burman@Aniket-Burman-JDXHW2PH34.local> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Type of Change
Description
This PR introduces an API to list all payment attempts associated with a given intent_id.
Why this is needed:
In payment flows that involve retries—such as smart , cascading retires —a single payment intent may result in multiple attempts. Previously, there was no clean way to retrieve all these attempts together.
Implemented API Flow:
Additional Changes
Motivation and Context
How did you test it?
I inserted two payment attempts for a payment intent as part of testing.
Curl
Response
Checklist
cargo +nightly fmt --allcargo clippy