feat(router): [worldpayvantiv] add dispute list sync and implement dispute (#8830)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Jagan <jaganelavarasan@gmail.com>
This commit is contained in:
AkshayaFoiger
2025-08-06 15:31:25 +05:30
committed by GitHub
parent 57e92c9fda
commit 640d0552f9
69 changed files with 3597 additions and 233 deletions

View File

@ -2183,6 +2183,10 @@ pub struct ProfileCreate {
/// It is used in payment processing, fraud detection, and regulatory compliance to determine regional rules and routing behavior.
#[schema(value_type = Option<MerchantCountryCode>, example = "840")]
pub merchant_country_code: Option<common_types::payments::MerchantCountryCode>,
/// Time interval (in hours) for polling the connector to check dispute statuses
#[schema(value_type = Option<i32>, example = 2)]
pub dispute_polling_interval: Option<primitive_wrappers::DisputePollingIntervalInHours>,
}
#[nutype::nutype(
@ -2518,6 +2522,9 @@ pub struct ProfileResponse {
/// It is used in payment processing, fraud detection, and regulatory compliance to determine regional rules and routing behavior.
#[schema(value_type = Option<MerchantCountryCode>, example = "840")]
pub merchant_country_code: Option<common_types::payments::MerchantCountryCode>,
#[schema(value_type = Option<u32>, example = 2)]
pub dispute_polling_interval: Option<primitive_wrappers::DisputePollingIntervalInHours>,
}
#[cfg(feature = "v2")]
@ -2846,6 +2853,9 @@ pub struct ProfileUpdate {
/// It is used in payment processing, fraud detection, and regulatory compliance to determine regional rules and routing behavior.
#[schema(value_type = Option<MerchantCountryCode>, example = "840")]
pub merchant_country_code: Option<common_types::payments::MerchantCountryCode>,
#[schema(value_type = Option<u32>, example = 2)]
pub dispute_polling_interval: Option<primitive_wrappers::DisputePollingIntervalInHours>,
}
#[cfg(feature = "v2")]

View File

@ -224,12 +224,26 @@ pub struct DeleteEvidenceRequest {
pub evidence_type: EvidenceType,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct DisputeRetrieveRequest {
/// The identifier for dispute
pub dispute_id: String,
/// Decider to enable or disable the connector call for dispute retrieve request
pub force_sync: Option<bool>,
}
#[derive(Clone, Debug, serde::Serialize)]
pub struct DisputesAggregateResponse {
/// Different status of disputes with their count
pub status_with_count: HashMap<DisputeStatus, i64>,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct DisputeRetrieveBody {
/// Decider to enable or disable the connector call for dispute retrieve request
pub force_sync: Option<bool>,
}
fn parse_comma_separated<'de, D, T>(v: D) -> Result<Option<Vec<T>>, D::Error>
where
D: serde::Deserializer<'de>,

View File

@ -2,7 +2,7 @@ use common_utils::events::{ApiEventMetric, ApiEventsType};
use super::{
DeleteEvidenceRequest, DisputeResponse, DisputeResponsePaymentsRetrieve,
DisputesAggregateResponse, SubmitEvidenceRequest,
DisputeRetrieveRequest, DisputesAggregateResponse, SubmitEvidenceRequest,
};
impl ApiEventMetric for SubmitEvidenceRequest {
@ -12,6 +12,15 @@ impl ApiEventMetric for SubmitEvidenceRequest {
})
}
}
impl ApiEventMetric for DisputeRetrieveRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Dispute {
dispute_id: self.dispute_id.clone(),
})
}
}
impl ApiEventMetric for DisputeResponsePaymentsRetrieve {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Dispute {

View File

@ -19,3 +19,9 @@ pub struct FileMetadataResponse {
/// File availability
pub available: bool,
}
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
pub struct FileRetrieveQuery {
///Dispute Id
pub dispute_id: Option<String>,
}

View File

@ -242,32 +242,32 @@ impl From<IncomingWebhookEvent> for WebhookFlow {
pub type MerchantWebhookConfig = std::collections::HashSet<IncomingWebhookEvent>;
#[derive(Clone)]
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)]
pub enum RefundIdType {
RefundId(String),
ConnectorRefundId(String),
}
#[derive(Clone)]
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)]
pub enum MandateIdType {
MandateId(String),
ConnectorMandateId(String),
}
#[derive(Clone)]
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)]
pub enum AuthenticationIdType {
AuthenticationId(common_utils::id_type::AuthenticationId),
ConnectorAuthenticationId(String),
}
#[cfg(feature = "payouts")]
#[derive(Clone)]
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)]
pub enum PayoutIdType {
PayoutAttemptId(String),
ConnectorPayoutId(String),
}
#[derive(Clone)]
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)]
pub enum ObjectReferenceId {
PaymentId(payments::PaymentIdType),
RefundId(RefundIdType),
@ -280,7 +280,7 @@ pub enum ObjectReferenceId {
}
#[cfg(all(feature = "revenue_recovery", feature = "v2"))]
#[derive(Clone)]
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)]
pub enum InvoiceIdType {
ConnectorInvoiceId(String),
}