refactor(connector): rename RevenueRecoveryRecordBack as InvoiceRecordBack (#9321)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Jagan
2025-09-10 18:54:19 +05:30
committed by GitHub
parent 3f8943bd46
commit ea2fd1d476
21 changed files with 165 additions and 196 deletions

View File

@ -19,7 +19,7 @@ use async_trait::async_trait;
use common_types::payments::CustomerAcceptance;
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
use hyperswitch_domain_models::router_flow_types::{
BillingConnectorInvoiceSync, BillingConnectorPaymentsSync, RecoveryRecordBack,
BillingConnectorInvoiceSync, BillingConnectorPaymentsSync, InvoiceRecordBack,
};
use hyperswitch_domain_models::router_request_types::PaymentsCaptureData;

View File

@ -1361,12 +1361,12 @@ async fn record_back_to_billing_connector(
.attach_printable("invalid connector name received in billing merchant connector account")?;
let connector_integration: services::BoxedRevenueRecoveryRecordBackInterface<
router_flow_types::RecoveryRecordBack,
revenue_recovery_request::RevenueRecoveryRecordBackRequest,
revenue_recovery_response::RevenueRecoveryRecordBackResponse,
router_flow_types::InvoiceRecordBack,
revenue_recovery_request::InvoiceRecordBackRequest,
revenue_recovery_response::InvoiceRecordBackResponse,
> = connector_data.connector.get_connector_integration();
let router_data = construct_recovery_record_back_router_data(
let router_data = construct_invoice_record_back_router_data(
state,
billing_mca,
payment_attempt,
@ -1396,13 +1396,13 @@ async fn record_back_to_billing_connector(
Ok(())
}
pub fn construct_recovery_record_back_router_data(
pub fn construct_invoice_record_back_router_data(
state: &SessionState,
billing_mca: &merchant_connector_account::MerchantConnectorAccount,
payment_attempt: &PaymentAttempt,
payment_intent: &PaymentIntent,
) -> RecoveryResult<hyperswitch_domain_models::types::RevenueRecoveryRecordBackRouterData> {
logger::info!("Entering construct_recovery_record_back_router_data");
) -> RecoveryResult<hyperswitch_domain_models::types::InvoiceRecordBackRouterData> {
logger::info!("Entering construct_invoice_record_back_router_data");
let auth_type: types::ConnectorAuthType =
helpers::MerchantConnectorAccountType::DbVal(Box::new(billing_mca.clone()))
@ -1433,11 +1433,11 @@ pub fn construct_recovery_record_back_router_data(
))?;
let router_data = router_data_v2::RouterDataV2 {
flow: PhantomData::<router_flow_types::RecoveryRecordBack>,
flow: PhantomData::<router_flow_types::InvoiceRecordBack>,
tenant_id: state.tenant.tenant_id.clone(),
resource_common_data: flow_common_types::RevenueRecoveryRecordBackData,
resource_common_data: flow_common_types::InvoiceRecordBackData,
connector_auth_type: auth_type,
request: revenue_recovery_request::RevenueRecoveryRecordBackRequest {
request: revenue_recovery_request::InvoiceRecordBackRequest {
merchant_reference_id,
amount: payment_attempt.get_total_amount(),
currency: payment_intent.amount_details.currency,
@ -1451,10 +1451,9 @@ pub fn construct_recovery_record_back_router_data(
},
response: Err(types::ErrorResponse::default()),
};
let old_router_data =
flow_common_types::RevenueRecoveryRecordBackData::to_old_router_data(router_data)
.change_context(errors::RecoveryError::RecordBackToBillingConnectorFailed)
.attach_printable("Cannot construct record back router data")?;
let old_router_data = flow_common_types::InvoiceRecordBackData::to_old_router_data(router_data)
.change_context(errors::RecoveryError::RecordBackToBillingConnectorFailed)
.attach_printable("Cannot construct record back router data")?;
Ok(old_router_data)
}

View File

@ -105,7 +105,7 @@ pub type BoxedAccessTokenConnectorIntegrationInterface<T, Req, Resp> =
pub type BoxedFilesConnectorIntegrationInterface<T, Req, Resp> =
BoxedConnectorIntegrationInterface<T, common_types::FilesFlowData, Req, Resp>;
pub type BoxedRevenueRecoveryRecordBackInterface<T, Req, Res> =
BoxedConnectorIntegrationInterface<T, common_types::RevenueRecoveryRecordBackData, Req, Res>;
BoxedConnectorIntegrationInterface<T, common_types::InvoiceRecordBackData, Req, Res>;
pub type BoxedBillingConnectorInvoiceSyncIntegrationInterface<T, Req, Res> =
BoxedConnectorIntegrationInterface<
T,

View File

@ -61,7 +61,7 @@ pub use hyperswitch_domain_models::{
router_request_types::{
revenue_recovery::{
BillingConnectorInvoiceSyncRequest, BillingConnectorPaymentsSyncRequest,
RevenueRecoveryRecordBackRequest,
InvoiceRecordBackRequest,
},
unified_authentication_service::{
UasAuthenticationRequestData, UasAuthenticationResponseData,
@ -87,7 +87,7 @@ pub use hyperswitch_domain_models::{
router_response_types::{
revenue_recovery::{
BillingConnectorInvoiceSyncResponse, BillingConnectorPaymentsSyncResponse,
RevenueRecoveryRecordBackResponse,
InvoiceRecordBackResponse,
},
AcceptDisputeResponse, CaptureSyncResponse, DefendDisputeResponse, DisputeSyncResponse,
FetchDisputesResponse, MandateReference, MandateRevokeResponseData, PaymentsResponseData,