mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 12:15:40 +08:00
feat(router): add disputes block in payments retrieve response (#1038)
This commit is contained in:
committed by
GitHub
parent
7c7185bc1a
commit
1304d912e5
@ -4,7 +4,7 @@ use utoipa::ToSchema;
|
||||
|
||||
use super::enums::{DisputeStage, DisputeStatus};
|
||||
|
||||
#[derive(Default, Clone, Debug, Serialize, ToSchema)]
|
||||
#[derive(Clone, Debug, Serialize, ToSchema, Eq, PartialEq)]
|
||||
pub struct DisputeResponse {
|
||||
/// The identifier for dispute
|
||||
pub dispute_id: String,
|
||||
@ -35,12 +35,43 @@ pub struct DisputeResponse {
|
||||
pub challenge_required_by: Option<PrimitiveDateTime>,
|
||||
/// Dispute created time sent by connector
|
||||
#[serde(with = "common_utils::custom_serde::iso8601::option")]
|
||||
pub created_at: Option<PrimitiveDateTime>,
|
||||
pub connector_created_at: Option<PrimitiveDateTime>,
|
||||
/// Dispute updated time sent by connector
|
||||
#[serde(with = "common_utils::custom_serde::iso8601::option")]
|
||||
pub updated_at: Option<PrimitiveDateTime>,
|
||||
pub connector_updated_at: Option<PrimitiveDateTime>,
|
||||
/// Time at which dispute is received
|
||||
pub received_at: String,
|
||||
#[serde(with = "common_utils::custom_serde::iso8601")]
|
||||
pub created_at: PrimitiveDateTime,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, ToSchema, Eq, PartialEq)]
|
||||
pub struct DisputeResponsePaymentsRetrieve {
|
||||
/// The identifier for dispute
|
||||
pub dispute_id: String,
|
||||
/// Stage of the dispute
|
||||
pub dispute_stage: DisputeStage,
|
||||
/// Status of the dispute
|
||||
pub dispute_status: DisputeStatus,
|
||||
/// Status of the dispute sent by connector
|
||||
pub connector_status: String,
|
||||
/// Dispute id sent by connector
|
||||
pub connector_dispute_id: String,
|
||||
/// Reason of dispute sent by connector
|
||||
pub connector_reason: Option<String>,
|
||||
/// Reason code of dispute sent by connector
|
||||
pub connector_reason_code: Option<String>,
|
||||
/// Evidence deadline of dispute sent by connector
|
||||
#[serde(with = "common_utils::custom_serde::iso8601::option")]
|
||||
pub challenge_required_by: Option<PrimitiveDateTime>,
|
||||
/// Dispute created time sent by connector
|
||||
#[serde(with = "common_utils::custom_serde::iso8601::option")]
|
||||
pub connector_created_at: Option<PrimitiveDateTime>,
|
||||
/// Dispute updated time sent by connector
|
||||
#[serde(with = "common_utils::custom_serde::iso8601::option")]
|
||||
pub connector_updated_at: Option<PrimitiveDateTime>,
|
||||
/// Time at which dispute is received
|
||||
#[serde(with = "common_utils::custom_serde::iso8601")]
|
||||
pub created_at: PrimitiveDateTime,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, ToSchema)]
|
||||
|
||||
@ -7,7 +7,7 @@ use router_derive::Setter;
|
||||
use time::PrimitiveDateTime;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
use crate::{admin, enums as api_enums, refunds};
|
||||
use crate::{admin, disputes, enums as api_enums, refunds};
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub enum PaymentOp {
|
||||
@ -1035,6 +1035,10 @@ pub struct PaymentsResponse {
|
||||
#[schema(value_type = Option<Vec<RefundResponse>>)]
|
||||
pub refunds: Option<Vec<refunds::RefundResponse>>,
|
||||
|
||||
/// List of dispute that happened on this intent
|
||||
#[schema(value_type = Option<Vec<DisputeResponsePaymentsRetrieve>>)]
|
||||
pub disputes: Option<Vec<disputes::DisputeResponsePaymentsRetrieve>>,
|
||||
|
||||
/// A unique identifier to link the payment to a mandate, can be use instead of payment_method_data
|
||||
#[schema(max_length = 255, example = "mandate_iwer89rnjef349dni3")]
|
||||
pub mandate_id: Option<String>,
|
||||
|
||||
Reference in New Issue
Block a user