feat(core): Adds Billing Connector Invoice Sync flow in Revenue Recovery (#7799)

Co-authored-by: Nishanth Challa <nishanth.challa@Nishanth-Challa-C0WGKCFHLF.local>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
CHALLA NISHANTH BABU
2025-04-29 12:25:31 +05:30
committed by GitHub
parent 600137275f
commit 3d0dd5bd1a
14 changed files with 294 additions and 34 deletions

View File

@ -1,12 +1,16 @@
//! Revenue Recovery Interface
use hyperswitch_domain_models::{
router_flow_types::{BillingConnectorPaymentsSync, RecoveryRecordBack},
router_flow_types::{
BillingConnectorInvoiceSync, BillingConnectorPaymentsSync, RecoveryRecordBack,
},
router_request_types::revenue_recovery::{
BillingConnectorPaymentsSyncRequest, RevenueRecoveryRecordBackRequest,
BillingConnectorInvoiceSyncRequest, BillingConnectorPaymentsSyncRequest,
RevenueRecoveryRecordBackRequest,
},
router_response_types::revenue_recovery::{
BillingConnectorPaymentsSyncResponse, RevenueRecoveryRecordBackResponse,
BillingConnectorInvoiceSyncResponse, BillingConnectorPaymentsSyncResponse,
RevenueRecoveryRecordBackResponse,
},
};
@ -17,7 +21,10 @@ use super::ConnectorIntegration;
/// trait RevenueRecovery
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
pub trait RevenueRecovery:
ConnectorCommon + BillingConnectorPaymentsSyncIntegration + RevenueRecoveryRecordBack
ConnectorCommon
+ BillingConnectorPaymentsSyncIntegration
+ RevenueRecoveryRecordBack
+ BillingConnectorInvoiceSyncIntegration
{
}
@ -41,6 +48,16 @@ pub trait RevenueRecoveryRecordBack:
{
}
/// trait BillingConnectorInvoiceSyncIntegration
pub trait BillingConnectorInvoiceSyncIntegration:
ConnectorIntegration<
BillingConnectorInvoiceSync,
BillingConnectorInvoiceSyncRequest,
BillingConnectorInvoiceSyncResponse,
>
{
}
#[cfg(not(all(feature = "v2", feature = "revenue_recovery")))]
/// trait RevenueRecovery
pub trait RevenueRecovery {}

View File

@ -2,14 +2,19 @@
use hyperswitch_domain_models::{
router_data_v2::flow_common_types::{
BillingConnectorPaymentsSyncFlowData, RevenueRecoveryRecordBackData,
BillingConnectorInvoiceSyncFlowData, BillingConnectorPaymentsSyncFlowData,
RevenueRecoveryRecordBackData,
},
router_flow_types::{
BillingConnectorInvoiceSync, BillingConnectorPaymentsSync, RecoveryRecordBack,
},
router_flow_types::{BillingConnectorPaymentsSync, RecoveryRecordBack},
router_request_types::revenue_recovery::{
BillingConnectorPaymentsSyncRequest, RevenueRecoveryRecordBackRequest,
BillingConnectorInvoiceSyncRequest, BillingConnectorPaymentsSyncRequest,
RevenueRecoveryRecordBackRequest,
},
router_response_types::revenue_recovery::{
BillingConnectorPaymentsSyncResponse, RevenueRecoveryRecordBackResponse,
BillingConnectorInvoiceSyncResponse, BillingConnectorPaymentsSyncResponse,
RevenueRecoveryRecordBackResponse,
},
};
@ -17,7 +22,9 @@ use crate::connector_integration_v2::ConnectorIntegrationV2;
/// trait RevenueRecoveryV2
pub trait RevenueRecoveryV2:
BillingConnectorPaymentsSyncIntegrationV2 + RevenueRecoveryRecordBackV2
BillingConnectorPaymentsSyncIntegrationV2
+ RevenueRecoveryRecordBackV2
+ BillingConnectorInvoiceSyncIntegrationV2
{
}
@ -42,3 +49,14 @@ pub trait RevenueRecoveryRecordBackV2:
>
{
}
/// trait BillingConnectorInvoiceSyncIntegrationV2
pub trait BillingConnectorInvoiceSyncIntegrationV2:
ConnectorIntegrationV2<
BillingConnectorInvoiceSync,
BillingConnectorInvoiceSyncFlowData,
BillingConnectorInvoiceSyncRequest,
BillingConnectorInvoiceSyncResponse,
>
{
}

View File

@ -19,9 +19,13 @@ use hyperswitch_domain_models::{
Authenticate, AuthenticationConfirmation, PostAuthenticate, PreAuthenticate,
},
webhooks::VerifyWebhookSource,
BillingConnectorInvoiceSync,
},
router_request_types::{
revenue_recovery::{BillingConnectorPaymentsSyncRequest, RevenueRecoveryRecordBackRequest},
revenue_recovery::{
BillingConnectorInvoiceSyncRequest, BillingConnectorPaymentsSyncRequest,
RevenueRecoveryRecordBackRequest,
},
unified_authentication_service::{
UasAuthenticationRequestData, UasAuthenticationResponseData,
UasConfirmationRequestData, UasPostAuthenticationRequestData,
@ -39,7 +43,8 @@ use hyperswitch_domain_models::{
},
router_response_types::{
revenue_recovery::{
BillingConnectorPaymentsSyncResponse, RevenueRecoveryRecordBackResponse,
BillingConnectorInvoiceSyncResponse, BillingConnectorPaymentsSyncResponse,
RevenueRecoveryRecordBackResponse,
},
AcceptDisputeResponse, DefendDisputeResponse, MandateRevokeResponseData,
PaymentsResponseData, RefundsResponseData, RetrieveFileResponse, SubmitEvidenceResponse,
@ -245,3 +250,10 @@ pub type BillingConnectorPaymentsSyncType = dyn ConnectorIntegration<
BillingConnectorPaymentsSyncRequest,
BillingConnectorPaymentsSyncResponse,
>;
/// Type alias for `ConnectorIntegration<BillingConnectorInvoiceSync, BillingConnectorInvoiceSyncRequest, BillingConnectorInvoiceSyncResponse>`
pub type BillingConnectorInvoiceSyncType = dyn ConnectorIntegration<
BillingConnectorInvoiceSync,
BillingConnectorInvoiceSyncRequest,
BillingConnectorInvoiceSyncResponse,
>;