mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
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:
@ -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;
|
||||
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user