mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
feat(refunds_v2): Add refunds list flow in v2 apis (#7966)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -330,6 +330,7 @@ pub struct RefundErrorDetails {
|
||||
pub message: String,
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1")]
|
||||
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize, ToSchema)]
|
||||
pub struct RefundListRequest {
|
||||
/// The identifier for the payment
|
||||
@ -361,7 +362,35 @@ pub struct RefundListRequest {
|
||||
#[schema(value_type = Option<Vec<RefundStatus>>)]
|
||||
pub refund_status: Option<Vec<enums::RefundStatus>>,
|
||||
}
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize, ToSchema)]
|
||||
pub struct RefundListRequest {
|
||||
/// The identifier for the payment
|
||||
#[schema(value_type = Option<String>)]
|
||||
pub payment_id: Option<common_utils::id_type::GlobalPaymentId>,
|
||||
/// The identifier for the refund
|
||||
pub refund_id: Option<common_utils::id_type::GlobalRefundId>,
|
||||
/// Limit on the number of objects to return
|
||||
pub limit: Option<i64>,
|
||||
/// The starting point within a list of objects
|
||||
pub offset: Option<i64>,
|
||||
/// The time range for which objects are needed. TimeRange has two fields start_time and end_time from which objects can be filtered as per required scenarios (created_at, time less than, greater than etc)
|
||||
#[serde(flatten)]
|
||||
pub time_range: Option<TimeRange>,
|
||||
/// The amount to filter reufnds list. Amount takes two option fields start_amount and end_amount from which objects can be filtered as per required scenarios (less_than, greater_than, equal_to and range)
|
||||
pub amount_filter: Option<AmountFilter>,
|
||||
/// The list of connectors to filter refunds list
|
||||
pub connector: Option<Vec<String>>,
|
||||
/// The list of merchant connector ids to filter the refunds list for selected label
|
||||
#[schema(value_type = Option<Vec<String>>)]
|
||||
pub connector_id_list: Option<Vec<common_utils::id_type::MerchantConnectorAccountId>>,
|
||||
/// The list of currencies to filter refunds list
|
||||
#[schema(value_type = Option<Vec<Currency>>)]
|
||||
pub currency: Option<Vec<enums::Currency>>,
|
||||
/// The list of refund statuses to filter refunds list
|
||||
#[schema(value_type = Option<Vec<RefundStatus>>)]
|
||||
pub refund_status: Option<Vec<enums::RefundStatus>>,
|
||||
}
|
||||
#[derive(Debug, Clone, Eq, PartialEq, Serialize, ToSchema)]
|
||||
pub struct RefundListResponse {
|
||||
/// The number of refunds included in the list
|
||||
|
||||
Reference in New Issue
Block a user