feat(router): Add Payments - List endpoint for v2 (#7191)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Anurag Thakur
2025-02-20 16:39:38 +05:30
committed by GitHub
parent 74bbf4bf27
commit d1f537e229
20 changed files with 1814 additions and 89 deletions

View File

@ -127,6 +127,7 @@ Never share your secret api keys. Keep them guarded and secure.
routes::payments::payments_create_and_confirm_intent,
routes::payments::payments_connector_session,
routes::payments::list_payment_methods,
routes::payments::payments_list,
//Routes for payment methods
routes::payment_method::create_payment_method_api,
@ -375,6 +376,7 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::payments::ConnectorTokenDetails,
api_models::payments::PaymentsRequest,
api_models::payments::PaymentsResponse,
api_models::payments::PaymentsListResponseItem,
api_models::payments::PaymentRetrieveBody,
api_models::payments::PaymentsRetrieveRequest,
api_models::payments::PaymentsCaptureRequest,
@ -437,7 +439,7 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::payments::SamsungPayCardBrand,
api_models::payments::SamsungPayTokenData,
api_models::payments::PaymentsCancelRequest,
api_models::payments::PaymentListConstraints,
api_models::payments::PaymentListResponse,
api_models::payments::CashappQr,
api_models::payments::BankTransferData,
api_models::payments::BankTransferNextStepsData,
@ -493,6 +495,9 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::payments::PaymentsConfirmIntentResponse,
api_models::payments::AmountDetailsResponse,
api_models::payments::BankCodeResponse,
api_models::payments::Order,
api_models::payments::SortOn,
api_models::payments::SortBy,
api_models::payments::PaymentMethodListResponseForPayments,
api_models::payments::ResponsePaymentMethodTypesForPayments,
api_models::payment_methods::RequiredFieldInfo,

View File

@ -457,6 +457,7 @@ pub fn payments_cancel() {}
/// Payments - List
///
/// To list the *payments*
#[cfg(feature = "v1")]
#[utoipa::path(
get,
path = "/payments/list",
@ -846,3 +847,21 @@ pub(crate) enum ForceSync {
security(("publishable_key" = []))
)]
pub fn list_payment_methods() {}
/// Payments - List
///
/// To list the *payments*
#[cfg(feature = "v2")]
#[utoipa::path(
get,
path = "/v2/payments/list",
params(api_models::payments::PaymentListConstraints),
responses(
(status = 200, description = "Successfully retrieved a payment list", body = PaymentListResponse),
(status = 404, description = "No payments found")
),
tag = "Payments",
operation_id = "List all Payments",
security(("api_key" = []), ("jwt_key" = []))
)]
pub fn payments_list() {}