Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
feat(platform): UCS functions in payments core (#10867)
Sandeep Kumar9bbe4d595f22
diff --git a/crates/router/src/core/fraud_check.rs b/crates/router/src/core/fraud_check.rsindex 27f4e147b0..11c6eeeae6 100644--- a/crates/router/src/core/fraud_check.rs+++ b/crates/router/src/core/fraud_check.rs@@ -111,7 +111,7 @@ where.construct_router_data(state,&frm_data.connector_details.connector_name,- platform,+ platform.get_processor(),customer,&merchant_connector_account,None,@@ -855,7 +855,7 @@ pub async fn make_fulfillment_api_call(&state,&payment_intent,&payment_attempt,- &platform,+ platform.get_processor(),fraud_check.frm_name.clone(),req,)diff --git a/crates/router/src/core/fraud_check/flows/checkout_flow.rs b/crates/router/src/core/fraud_check/flows/checkout_flow.rsindex 855657a15b..988b23bb8b 100644--- a/crates/router/src/core/fraud_check/flows/checkout_flow.rs+++ b/crates/router/src/core/fraud_check/flows/checkout_flow.rs@@ -30,7 +30,7 @@ impl ConstructFlowSpecificData<frm_api::Checkout, FraudCheckCheckoutData, FraudC&self,_state: &SessionState,_connector_id: &str,- _platform: &domain::Platform,+ _processor: &domain::Processor,_customer: &Option<domain::Customer>,_merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,_merchant_recipient_data: Option<MerchantRecipientData>,@@ -45,7 +45,7 @@ impl ConstructFlowSpecificData<frm_api::Checkout, FraudCheckCheckoutData, FraudC&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,_merchant_recipient_data: Option<MerchantRecipientData>,@@ -70,7 +70,7 @@ impl ConstructFlowSpecificData<frm_api::Checkout, FraudCheckCheckoutData, FraudClet router_data = RouterData {flow: std::marker::PhantomData,- merchant_id: platform.get_processor().get_account().get_id().clone(),+ merchant_id: processor.get_account().get_id().clone(),customer_id,tenant_id: state.tenant.tenant_id.clone(),connector: connector_id.to_string(),diff --git a/crates/router/src/core/fraud_check/flows/fulfillment_flow.rs b/crates/router/src/core/fraud_check/flows/fulfillment_flow.rsindex ab56714d1c..3242807d50 100644--- a/crates/router/src/core/fraud_check/flows/fulfillment_flow.rs+++ b/crates/router/src/core/fraud_check/flows/fulfillment_flow.rs@@ -21,7 +21,7 @@ pub async fn construct_fulfillment_router_data<'a>(_state: &'a SessionState,_payment_intent: &'a storage::PaymentIntent,_payment_attempt: &storage::PaymentAttempt,- _platform: &domain::Platform,+ _processor: &domain::Processor,_connector: String,_fulfillment_request: FrmFulfillmentRequest,) -> RouterResult<FrmFulfillmentRouterData> {@@ -34,7 +34,7 @@ pub async fn construct_fulfillment_router_data<'a>(state: &'a SessionState,payment_intent: &'a storage::PaymentIntent,payment_attempt: &storage::PaymentAttempt,- platform: &domain::Platform,+ processor: &domain::Processor,connector: String,fulfillment_request: FrmFulfillmentRequest,) -> RouterResult<FrmFulfillmentRouterData> {@@ -50,9 +50,9 @@ pub async fn construct_fulfillment_router_data<'a>(let merchant_connector_account = helpers::get_merchant_connector_account(state,- platform.get_processor().get_account().get_id(),+ processor.get_account().get_id(),None,- platform.get_processor().get_key_store(),+ processor.get_key_store(),&profile_id,&connector,None,@@ -69,7 +69,7 @@ pub async fn construct_fulfillment_router_data<'a>(let router_data = RouterData {flow: std::marker::PhantomData,- merchant_id: platform.get_processor().get_account().get_id().clone(),+ merchant_id: processor.get_account().get_id().clone(),tenant_id: state.tenant.tenant_id.clone(),connector,payment_id: payment_attempt.payment_id.get_string_repr().to_owned(),@@ -108,7 +108,7 @@ pub async fn construct_fulfillment_router_data<'a>(payment_method_balance: None,connector_request_reference_id: core_utils::get_connector_request_reference_id(&state.conf,- platform.get_processor(),+ processor,payment_intent,payment_attempt,&connector_id,diff --git a/crates/router/src/core/fraud_check/flows/record_return.rs b/crates/router/src/core/fraud_check/flows/record_return.rsindex 96115add55..c0a46822bd 100644--- a/crates/router/src/core/fraud_check/flows/record_return.rs+++ b/crates/router/src/core/fraud_check/flows/record_return.rs@@ -31,7 +31,7 @@ impl ConstructFlowSpecificData<RecordReturn, FraudCheckRecordReturnData, FraudCh&self,_state: &SessionState,_connector_id: &str,- _platform: &domain::Platform,+ _processor: &domain::Processor,_customer: &Option<domain::Customer>,_merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,_merchant_recipient_data: Option<MerchantRecipientData>,@@ -46,7 +46,7 @@ impl ConstructFlowSpecificData<RecordReturn, FraudCheckRecordReturnData, FraudCh&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,_merchant_recipient_data: Option<MerchantRecipientData>,@@ -68,7 +68,7 @@ impl ConstructFlowSpecificData<RecordReturn, FraudCheckRecordReturnData, FraudChlet currency = self.payment_attempt.clone().currency;let router_data = RouterData {flow: std::marker::PhantomData,- merchant_id: platform.get_processor().get_account().get_id().clone(),+ merchant_id: processor.get_account().get_id().clone(),tenant_id: state.tenant.tenant_id.clone(),customer_id,connector: connector_id.to_string(),diff --git a/crates/router/src/core/fraud_check/flows/sale_flow.rs b/crates/router/src/core/fraud_check/flows/sale_flow.rsindex 9b5b3ed514..14673b0995 100644--- a/crates/router/src/core/fraud_check/flows/sale_flow.rs+++ b/crates/router/src/core/fraud_check/flows/sale_flow.rs@@ -29,7 +29,7 @@ impl ConstructFlowSpecificData<frm_api::Sale, FraudCheckSaleData, FraudCheckResp&self,_state: &SessionState,_connector_id: &str,- _platform: &domain::Platform,+ _processor: &domain::Processor,_customer: &Option<domain::Customer>,_merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,_merchant_recipient_data: Option<MerchantRecipientData>,@@ -43,7 +43,7 @@ impl ConstructFlowSpecificData<frm_api::Sale, FraudCheckSaleData, FraudCheckResp&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,_merchant_recipient_data: Option<MerchantRecipientData>,@@ -64,7 +64,7 @@ impl ConstructFlowSpecificData<frm_api::Sale, FraudCheckSaleData, FraudCheckResplet router_data = RouterData {flow: std::marker::PhantomData,- merchant_id: platform.get_processor().get_account().get_id().clone(),+ merchant_id: processor.get_account().get_id().clone(),customer_id,connector: connector_id.to_string(),payment_id: self.payment_intent.payment_id.get_string_repr().to_owned(),diff --git a/crates/router/src/core/fraud_check/flows/transaction_flow.rs b/crates/router/src/core/fraud_check/flows/transaction_flow.rsindex b2ee8fe3d2..8a42921d0f 100644--- a/crates/router/src/core/fraud_check/flows/transaction_flow.rs+++ b/crates/router/src/core/fraud_check/flows/transaction_flow.rs@@ -34,7 +34,7 @@ impl&self,_state: &SessionState,_connector_id: &str,- _platform: &domain::Platform,+ _processor: &domain::Processor,_customer: &Option<domain::Customer>,_merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,_merchant_recipient_data: Option<MerchantRecipientData>,@@ -50,7 +50,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,_merchant_recipient_data: Option<MerchantRecipientData>,@@ -76,7 +76,7 @@ impllet router_data = RouterData {flow: std::marker::PhantomData,- merchant_id: platform.get_processor().get_account().get_id().clone(),+ merchant_id: processor.get_account().get_id().clone(),tenant_id: state.tenant.tenant_id.clone(),customer_id,connector: connector_id.to_string(),diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rsindex bc8104d1ae..1709bdcbf2 100644--- a/crates/router/src/core/payments.rs+++ b/crates/router/src/core/payments.rs@@ -265,27 +265,57 @@ where).await?;- let router_data = decide_unified_connector_service_call(- state,- req_state.clone(),- &platform,- connector_data.connector_data.clone(),+ let (call_connector_service_response, updated_state) =+ decide_unified_connector_service_call(+ state,+ req_state.clone(),+ platform.get_processor(),+ connector_data.connector_data.clone(),+ &operation,+ &mut payment_data,+ &customer,+ call_connector_action.clone(),+ None, // schedule_time is not used in PreDetermined ConnectorCallType+ header_payload.clone(),+ #[cfg(feature = "frm")]+ None,+ profile,+ false,+ false, //should_retry_with_pan is set to false in case of PreDetermined ConnectorCallType+ req.should_return_raw_response(),+ mca_type_details.clone(),+ router_data,+ tokenization_action,+ )+ .await?;++ // Update customer at provider level before update_trackers+ operation+ .to_domain()?+ .update_customer(+ &updated_state,+ platform.get_provider(),+ customer.clone(),+ updated_customer,+ )+ .await?;++ let (router_data, _mca_type_details) = complete_connector_service(+ &updated_state,+ platform.get_processor(),&operation,&mut payment_data,&customer,+ profile,+ req.should_return_raw_response(),+ &connector_data.connector_data,call_connector_action.clone(),- None, // schedule_time is not used in PreDetermined ConnectorCallType+ mca_type_details,+ req_state.clone(),header_payload.clone(),#[cfg(feature = "frm")]None,- profile,- false,- false, //should_retry_with_pan is set to false in case of PreDetermined ConnectorCallType- req.should_return_raw_response(),- mca_type_details,- router_data,- updated_customer,- tokenization_action,+ call_connector_service_response,).await?;@@ -334,27 +364,57 @@ where).await?;- let router_data = decide_unified_connector_service_call(- state,- req_state.clone(),- &platform,- connector_data.connector_data.clone(),+ let (call_connector_service_response, updated_state) =+ decide_unified_connector_service_call(+ state,+ req_state.clone(),+ platform.get_processor(),+ connector_data.connector_data.clone(),+ &operation,+ &mut payment_data,+ &customer,+ call_connector_action.clone(),+ None, // schedule_time is not used in Retryable ConnectorCallType+ header_payload.clone(),+ #[cfg(feature = "frm")]+ None,+ profile,+ true,+ false, //should_retry_with_pan is set to false in case of PreDetermined ConnectorCallType+ req.should_return_raw_response(),+ mca_type_details.clone(),+ router_data,+ tokenization_action,+ )+ .await?;++ // Update customer at provider level before update_trackers+ operation+ .to_domain()?+ .update_customer(+ &updated_state,+ platform.get_provider(),+ customer.clone(),+ updated_customer,+ )+ .await?;++ let (router_data, _mca_type_details) = complete_connector_service(+ &updated_state,+ platform.get_processor(),&operation,&mut payment_data,&customer,+ profile,+ req.should_return_raw_response(),+ &connector_data.connector_data,call_connector_action.clone(),- None, // schedule_time is not used in Retryable ConnectorCallType+ mca_type_details,+ req_state.clone(),header_payload.clone(),#[cfg(feature = "frm")]None,- profile,- true,- false, //should_retry_with_pan is set to false in case of PreDetermined ConnectorCallType- req.should_return_raw_response(),- mca_type_details,- router_data,- updated_customer,- tokenization_action,+ call_connector_service_response,).await?;@@ -846,29 +906,56 @@ where).await?;- let (router_data, mca) = decide_unified_connector_service_call(- state,- req_state.clone(),- platform,- connector.connector_data.clone(),+ let (updated_customer, call_connector_service_response, updated_state) =+ decide_unified_connector_service_call(+ state,+ platform.get_processor(),+ connector.connector_data.clone(),+ &operation,+ &mut payment_data,+ &customer,+ call_connector_action.clone(),+ shadow_ucs_call_connector_action.clone(),+ &validate_result,+ schedule_time,+ header_payload.clone(),+ &business_profile,+ false,+ merchant_connector_account.clone(),+ router_data,+ tokenization_action,+ )+ .await?;++ // Update customer at provider level before update_trackers+ operation+ .to_domain()?+ .update_customer(+ &updated_state,+ platform.get_provider(),+ customer.clone(),+ updated_customer,+ )+ .await?;++ let (router_data, mca) = complete_connector_service(+ &updated_state,+ platform.get_processor(),&operation,&mut payment_data,&customer,+ &business_profile,+ <Req as Authenticate>::should_return_raw_response(&req),+ &connector.connector_data,call_connector_action.clone(),- shadow_ucs_call_connector_action.clone(),- &validate_result,- schedule_time,+ merchant_connector_account,+ req_state.clone(),header_payload.clone(),#[cfg(feature = "frm")]frm_info.as_ref().and_then(|fi| fi.suggested_action),#[cfg(not(feature = "frm"))]None,- &business_profile,- false,- <Req as Authenticate>::should_return_raw_response(&req),- merchant_connector_account,- router_data,- tokenization_action,+ call_connector_service_response,).await?;@@ -911,7 +998,7 @@ whereif should_trigger_post_processing_flows {complete_postprocessing_steps_if_required(state,- platform,+ platform.get_processor(),&customer,&mca,&connector.connector_data,@@ -979,29 +1066,56 @@ where).await?;- let (router_data, mca) = decide_unified_connector_service_call(- state,- req_state.clone(),- platform,- connector_data.clone(),+ let (updated_customer, call_connector_service_response, updated_state) =+ decide_unified_connector_service_call(+ state,+ platform.get_processor(),+ connector_data.clone(),+ &operation,+ &mut payment_data,+ &customer,+ call_connector_action.clone(),+ shadow_ucs_call_connector_action,+ &validate_result,+ schedule_time,+ header_payload.clone(),+ &business_profile,+ false,+ merchant_connector_account.clone(),+ router_data,+ tokenization_action,+ )+ .await?;++ // Update customer at provider level before update_trackers+ operation+ .to_domain()?+ .update_customer(+ &updated_state,+ platform.get_provider(),+ customer.clone(),+ updated_customer,+ )+ .await?;++ let (router_data, mca) = complete_connector_service(+ &updated_state,+ platform.get_processor(),&operation,&mut payment_data,&customer,+ &business_profile,+ <Req as Authenticate>::should_return_raw_response(&req),+ &connector_data,call_connector_action.clone(),- shadow_ucs_call_connector_action,- &validate_result,- schedule_time,+ merchant_connector_account,+ req_state.clone(),header_payload.clone(),#[cfg(feature = "frm")]frm_info.as_ref().and_then(|fi| fi.suggested_action),#[cfg(not(feature = "frm"))]None,- &business_profile,- false,- <Req as Authenticate>::should_return_raw_response(&req),- merchant_connector_account,- router_data,- tokenization_action,+ call_connector_service_response,).await?;@@ -1078,7 +1192,7 @@ whereif should_trigger_post_processing_flows {complete_postprocessing_steps_if_required(state,- platform,+ platform.get_processor(),&customer,&mca,&connector_data,@@ -1433,7 +1547,7 @@ whereif should_trigger_post_processing_flows {complete_postprocessing_steps_if_required(state,- &platform,+ platform.get_processor(),&None,&mca,&connector,@@ -4056,13 +4170,20 @@ where.await}+pub struct ConnectorServiceIntermediateState<F, RouterDReq> {+ pub router_data: RouterData<F, RouterDReq, router_types::PaymentsResponseData>,+ pub connector_request: Option<services::Request>,+ pub should_continue_further: bool,+ pub gateway_context: gateway_context::RouterGatewayContext,+}+#[cfg(feature = "v1")]#[allow(clippy::too_many_arguments)]+#[allow(clippy::type_complexity)]#[instrument(skip_all)]pub async fn call_connector_service<F, RouterDReq, ApiRequest, D>(state: &SessionState,- req_state: ReqState,- platform: &domain::Platform,+ processor: &domain::Processor,connector: api::ConnectorData,operation: &BoxedOperation<'_, F, ApiRequest, D>,payment_data: &mut D,@@ -4070,18 +4191,14 @@ pub async fn call_connector_service<F, RouterDReq, ApiRequest, D>(call_connector_action: CallConnectorAction,validate_result: &operations::ValidateResult,schedule_time: Option<time::PrimitiveDateTime>,- header_payload: HeaderPayload,- frm_suggestion: Option<storage_enums::FrmSuggestion>,- business_profile: &domain::Profile,is_retry_payment: bool,- return_raw_connector_response: Option<bool>,merchant_connector_account: helpers::MerchantConnectorAccountType,mut router_data: RouterData<F, RouterDReq, router_types::PaymentsResponseData>,tokenization_action: TokenizationAction,context: gateway_context::RouterGatewayContext,) -> RouterResult<(- RouterData<F, RouterDReq, router_types::PaymentsResponseData>,- helpers::MerchantConnectorAccountType,+ Option<storage::CustomerUpdate>,+ ConnectorServiceIntermediateState<F, RouterDReq>,)>whereF: Send + Clone + Sync,@@ -4100,7 +4217,7 @@ where.add_access_token(state,&connector,- platform,+ processor,payment_data.get_creds_identifier(),&context,)@@ -4159,7 +4276,7 @@ wherelet updated_customer = call_create_connector_customer_if_required(state,customer,- platform,+ processor,&merchant_connector_account,payment_data,router_data.access_token.as_ref(),@@ -4363,29 +4480,69 @@ where.ok();}- // Update customer information at provider level and payment trackers in parallel- // Since the request is already built in the previous step,- // there should be no error in request construction from hyperswitch end- let ((), (_, new_payment_data)) = tokio::try_join!(- operation.to_domain()?.update_customer(- state,- platform.get_provider(),- customer.clone(),- updated_customer.clone(),- ),- operation.to_update_tracker()?.update_trackers(+ Ok((+ updated_customer,+ ConnectorServiceIntermediateState {+ router_data,+ connector_request,+ should_continue_further,+ gateway_context: context,+ },+ ))+}++#[cfg(feature = "v1")]+#[allow(clippy::too_many_arguments)]+#[instrument(skip_all)]+pub async fn complete_connector_service<F, RouterDReq, ApiRequest, D>(+ state: &SessionState,+ processor: &domain::Processor,+ operation: &BoxedOperation<'_, F, ApiRequest, D>,+ payment_data: &mut D,+ customer: &Option<domain::Customer>,+ business_profile: &domain::Profile,+ return_raw_connector_response: Option<bool>,+ connector: &api::ConnectorData,+ call_connector_action: CallConnectorAction,+ merchant_connector_account: helpers::MerchantConnectorAccountType,+ req_state: ReqState,+ header_payload: HeaderPayload,+ frm_suggestion: Option<storage_enums::FrmSuggestion>,+ call_connector_service_response: ConnectorServiceIntermediateState<F, RouterDReq>,+) -> RouterResult<(+ RouterData<F, RouterDReq, router_types::PaymentsResponseData>,+ helpers::MerchantConnectorAccountType,+)>+where+ F: Send + Clone + Sync,+ RouterDReq: Send + Sync,++ // To create connector flow specific interface data+ D: OperationSessionGetters<F> + OperationSessionSetters<F> + Send + Sync + Clone,+ D: ConstructFlowSpecificData<F, RouterDReq, router_types::PaymentsResponseData>,+ RouterData<F, RouterDReq, router_types::PaymentsResponseData>: Feature<F, RouterDReq> + Send,+ // To construct connector flow specific api+ dyn api::Connector: services::api::ConnectorIntegration<F, RouterDReq, router_types::PaymentsResponseData>+ + Send+ + Sync,+{+ // Update payment trackers+ let (_, new_payment_data) = operation+ .to_update_tracker()?+ .update_trackers(state,req_state,- platform.get_processor(),+ processor,payment_data.clone(),customer.clone(),frm_suggestion,header_payload.clone(),)- )?;+ .await?;*payment_data = new_payment_data;- let router_data = if should_continue_further {+ let mut router_data = call_connector_service_response.router_data;+ let router_data = if call_connector_service_response.should_continue_further {// The status of payment_attempt and intent will be updated in the previous step// update this in router_data.// This is added because few connector integrations do not update the status,@@ -4394,13 +4551,13 @@ whererouter_data.decide_flows(state,- &connector,+ connector,call_connector_action,- connector_request,+ call_connector_service_response.connector_request,business_profile,- header_payload.clone(),+ header_payload,return_raw_connector_response,- context,+ call_connector_service_response.gateway_context,).await} else {@@ -4541,7 +4698,7 @@ where.construct_router_data(state,connector.connector.id(),- platform,+ platform.get_processor(),customer,&merchant_connector_account,merchant_recipient_data,@@ -4560,11 +4717,11 @@ where#[cfg(feature = "v1")]#[allow(clippy::too_many_arguments)]+#[allow(clippy::type_complexity)]#[instrument(skip_all)]pub async fn decide_unified_connector_service_call<'a, F, RouterDReq, ApiRequest, D>(state: &'a SessionState,- req_state: ReqState,- platform: &'a domain::Platform,+ processor: &'a domain::Processor,connector: api::ConnectorData,operation: &'a BoxedOperation<'a, F, ApiRequest, D>,payment_data: &'a mut D,@@ -4574,16 +4731,15 @@ pub async fn decide_unified_connector_service_call<'a, F, RouterDReq, ApiRequestvalidate_result: &'a operations::ValidateResult,schedule_time: Option<time::PrimitiveDateTime>,header_payload: HeaderPayload,- frm_suggestion: Option<storage_enums::FrmSuggestion>,business_profile: &'a domain::Profile,is_retry_payment: bool,- all_keys_required: Option<bool>,merchant_connector_account: helpers::MerchantConnectorAccountType,router_data: RouterData<F, RouterDReq, router_types::PaymentsResponseData>,tokenization_action: TokenizationAction,) -> RouterResult<(- RouterData<F, RouterDReq, router_types::PaymentsResponseData>,- helpers::MerchantConnectorAccountType,+ Option<storage::CustomerUpdate>,+ ConnectorServiceIntermediateState<F, RouterDReq>,+ SessionState,)>whereF: Send + Clone + Sync + Debug + 'static,@@ -4603,7 +4759,7 @@ wherelet (execution_path, updated_state) = should_call_unified_connector_service(state,- platform,+ processor,&router_data,previous_gateway,call_connector_action.clone(),@@ -4625,7 +4781,7 @@ wherelet gateway_context = gateway_context::RouterGatewayContext {creds_identifier: payment_data.get_creds_identifier().map(|id| id.to_string()),- platform: platform.clone(),+ processor: processor.clone(),header_payload: header_payload.clone(),lineage_ids,merchant_connector_account: merchant_connector_account.clone(),@@ -4634,10 +4790,9 @@ where};// Update feature metadata to track Direct routing usage for stickinessupdate_gateway_system_in_feature_metadata(payment_data, gateway_context.get_gateway_system())?;- call_connector_service(+ let (updated_customer, call_connector_service_response) = call_connector_service(&updated_state,- req_state,- platform,+ processor,connector,operation,payment_data,@@ -4645,17 +4800,19 @@ wherecall_connector_action,validate_result,schedule_time,- header_payload,- frm_suggestion,- business_profile,is_retry_payment,- all_keys_required,merchant_connector_account,router_data,tokenization_action,gateway_context,)- .await+ .await?;++ Ok((+ updated_customer,+ call_connector_service_response,+ updated_state,+ ))}#[cfg(feature = "v2")]@@ -4674,11 +4831,12 @@ where#[cfg(feature = "v2")]#[allow(clippy::too_many_arguments)]+#[allow(clippy::type_complexity)]#[instrument(skip_all)]pub async fn call_connector_service<F, RouterDReq, ApiRequest, D>(state: &SessionState,req_state: ReqState,- platform: &domain::Platform,+ processor: &domain::Processor,connector: api::ConnectorData,operation: &BoxedOperation<'_, F, ApiRequest, D>,payment_data: &mut D,@@ -4693,10 +4851,9 @@ pub async fn call_connector_service<F, RouterDReq, ApiRequest, D>(return_raw_connector_response: Option<bool>,merchant_connector_account_type_details: domain::MerchantConnectorAccountTypeDetails,mut router_data: RouterData<F, RouterDReq, router_types::PaymentsResponseData>,- updated_customer: Option<storage::CustomerUpdate>,tokenization_action: TokenizationAction,gateway_context: gateway_context::RouterGatewayContext,-) -> RouterResult<RouterData<F, RouterDReq, router_types::PaymentsResponseData>>+) -> RouterResult<ConnectorServiceIntermediateState<F, RouterDReq>>whereF: Send + Clone + Sync,RouterDReq: Send + Sync,@@ -4714,7 +4871,7 @@ where.add_access_token(state,&connector,- platform,+ processor,payment_data.get_creds_identifier(),&gateway_context,)@@ -4777,29 +4934,66 @@ whereNone => (None, false),};- // Update customer information at provider level and payment trackers in parallel- // Since the request is already built in the previous step,- // there should be no error in request construction from hyperswitch end- let ((), (_, new_payment_data)) = tokio::try_join!(- operation.to_domain()?.update_customer(- state,- platform.get_provider(),- customer.clone(),- updated_customer.clone(),- ),- operation.to_update_tracker()?.update_trackers(+ Ok(ConnectorServiceIntermediateState {+ router_data,+ connector_request,+ should_continue_further,+ gateway_context,+ })+}++#[cfg(feature = "v2")]+#[allow(clippy::too_many_arguments)]+#[instrument(skip_all)]+pub async fn complete_connector_service<F, RouterDReq, ApiRequest, D>(+ state: &SessionState,+ processor: &domain::Processor,+ operation: &BoxedOperation<'_, F, ApiRequest, D>,+ payment_data: &mut D,+ customer: &Option<domain::Customer>,+ business_profile: &domain::Profile,+ return_raw_connector_response: Option<bool>,+ connector: &api::ConnectorData,+ call_connector_action: CallConnectorAction,+ merchant_connector_account_type_details: domain::MerchantConnectorAccountTypeDetails,+ req_state: ReqState,+ header_payload: HeaderPayload,+ frm_suggestion: Option<storage_enums::FrmSuggestion>,+ call_connector_service_response: ConnectorServiceIntermediateState<F, RouterDReq>,+) -> RouterResult<(+ RouterData<F, RouterDReq, router_types::PaymentsResponseData>,+ domain::MerchantConnectorAccountTypeDetails,+)>+where+ F: Send + Clone + Sync,+ RouterDReq: Send + Sync,++ // To create connector flow specific interface data+ D: OperationSessionGetters<F> + OperationSessionSetters<F> + Send + Sync + Clone,+ D: ConstructFlowSpecificData<F, RouterDReq, router_types::PaymentsResponseData>,+ RouterData<F, RouterDReq, router_types::PaymentsResponseData>: Feature<F, RouterDReq> + Send,+ // To construct connector flow specific api+ dyn api::Connector: services::api::ConnectorIntegration<F, RouterDReq, router_types::PaymentsResponseData>+ + Send+ + Sync,+{+ // Update payment trackers+ let (_, new_payment_data) = operation+ .to_update_tracker()?+ .update_trackers(state,req_state,- platform.get_processor(),+ processor,payment_data.clone(),customer.clone(),frm_suggestion,header_payload.clone(),)- )?;+ .await?;*payment_data = new_payment_data;- let router_data = if should_continue_further {+ let mut router_data = call_connector_service_response.router_data;+ let router_data = if call_connector_service_response.should_continue_further {// The status of payment_attempt and intent will be updated in the previous step// update this in router_data.// This is added because few connector integrations do not update the status,@@ -4809,20 +5003,20 @@ whererouter_data.decide_flows(state,- &connector,+ connector,call_connector_action,- connector_request,+ call_connector_service_response.connector_request,business_profile,- header_payload.clone(),+ header_payload,return_raw_connector_response,- gateway_context,+ call_connector_service_response.gateway_context,).await} else {Ok(router_data)}?;- Ok(router_data)+ Ok((router_data, merchant_connector_account_type_details))}#[cfg(feature = "v2")]@@ -4881,7 +5075,7 @@ wherelet updated_customer = call_create_connector_customer_if_required(state,customer,- platform,+ platform.get_processor(),&merchant_connector_account_type_details,payment_data,)@@ -4891,7 +5085,7 @@ where.construct_router_data(state,connector.connector.id(),- platform,+ platform.get_processor(),customer,&merchant_connector_account_type_details,None,@@ -5050,7 +5244,7 @@ where.construct_router_data(state,connector.connector.id(),- platform,+ platform.get_processor(),&None,&merchant_connector_account,None,@@ -5093,7 +5287,7 @@ where.construct_router_data(state,connector.connector.id(),- platform,+ platform.get_processor(),&None,&merchant_connector_account_type_details,None,@@ -5107,7 +5301,7 @@ where// do order creationlet (execution_path, updated_state) = should_call_unified_connector_service(state,- platform,+ platform.get_processor(),&router_data,previous_gateway,call_connector_action.clone(),@@ -5129,7 +5323,7 @@ wherelet gateway_context = gateway_context::RouterGatewayContext {creds_identifier: payment_data.get_creds_identifier().map(|id| id.to_string()),- platform: platform.clone(),+ processor: platform.get_processor().clone(),header_payload: header_payload.clone(),lineage_ids,merchant_connector_account: merchant_connector_account_type_details.clone(),@@ -5197,7 +5391,7 @@ wherepub async fn decide_unified_connector_service_call<F, RouterDReq, ApiRequest, D>(state: &SessionState,req_state: ReqState,- platform: &domain::Platform,+ processor: &domain::Processor,connector: api::ConnectorData,operation: &BoxedOperation<'_, F, ApiRequest, D>,payment_data: &mut D,@@ -5212,9 +5406,11 @@ pub async fn decide_unified_connector_service_call<F, RouterDReq, ApiRequest, D>return_raw_connector_response: Option<bool>,merchant_connector_account_type_details: domain::MerchantConnectorAccountTypeDetails,mut router_data: RouterData<F, RouterDReq, router_types::PaymentsResponseData>,- updated_customer: Option<storage::CustomerUpdate>,tokenization_action: TokenizationAction,-) -> RouterResult<RouterData<F, RouterDReq, router_types::PaymentsResponseData>>+) -> RouterResult<(+ ConnectorServiceIntermediateState<F, RouterDReq>,+ SessionState,+)>whereF: Send + Clone + Sync,RouterDReq: Send + Sync,@@ -5233,7 +5429,7 @@ wherelet (execution_path, updated_state) = should_call_unified_connector_service(state,- platform,+ processor,&router_data,previous_gateway,call_connector_action.clone(),@@ -5254,17 +5450,17 @@ wherelet gateway_context = gateway_context::RouterGatewayContext {creds_identifier: payment_data.get_creds_identifier().map(|id| id.to_string()),- platform: platform.clone(),+ processor: processor.clone(),header_payload: header_payload.clone(),lineage_ids,merchant_connector_account: merchant_connector_account_type_details.clone(),execution_path,execution_mode,};- call_connector_service(+ let call_connector_service_response = call_connector_service(&updated_state,req_state,- platform,+ processor,connector,operation,payment_data,@@ -5279,11 +5475,12 @@ wherereturn_raw_connector_response,merchant_connector_account_type_details,router_data,- updated_customer,tokenization_action,gateway_context,)- .await+ .await?;++ Ok((call_connector_service_response, updated_state))}).await}@@ -5356,7 +5553,7 @@ wherelineage_ids,merchant_connector_account_type_details.clone(),external_vault_merchant_connector_account_type_details.clone(),- platform,+ platform.get_processor(),ExecutionMode::Primary, //UCS is called in primary modemerchant_order_reference_id,)@@ -5428,7 +5625,7 @@ where.construct_router_data(state,connector.connector.id(),- platform,+ platform.get_processor(),customer,&merchant_connector_account,merchant_recipient_data,@@ -5440,7 +5637,7 @@ wherelet (execution_path, updated_state) = should_call_unified_connector_service(state,- platform,+ platform.get_processor(),&router_data,None,call_connector_action.clone(),@@ -5462,7 +5659,7 @@ wherelet gateway_context = gateway_context::RouterGatewayContext {creds_identifier: payment_data.get_creds_identifier().map(|id| id.to_string()),- platform: platform.clone(),+ processor: platform.get_processor().clone(),header_payload: header_payload.clone(),lineage_ids,merchant_connector_account: merchant_connector_account.clone(),@@ -5477,7 +5674,7 @@ where.add_access_token(&updated_state,&connector,- platform,+ platform.get_processor(),payment_data.get_creds_identifier(),&gateway_context,)@@ -5622,7 +5819,7 @@ where));let profile_id = payment_data.get_payment_intent().profile_id.clone();let default_gateway_context = gateway_context::RouterGatewayContext::direct(- platform.clone(),+ platform.get_processor().clone(),merchant_connector_account.clone(),payment_data.get_payment_intent().merchant_id.clone(),profile_id,@@ -5637,7 +5834,7 @@ where.construct_router_data(state,connector.connector.id(),- platform,+ platform.get_processor(),&None,&merchant_connector_account,None,@@ -5649,7 +5846,7 @@ where.add_access_token(state,&connector,- platform,+ platform.get_processor(),payment_data.get_creds_identifier(),&default_gateway_context,)@@ -5757,7 +5954,7 @@ where.construct_router_data(state,connector.connector.id(),- platform,+ platform.get_processor(),&None,&merchant_connector_account,None,@@ -5805,7 +6002,7 @@ where.await?;let gateway_context = gateway_context::RouterGatewayContext::direct(- platform.clone(),+ platform.get_processor().clone(),merchant_connector_account.clone(),business_profile.merchant_id.clone(),business_profile.get_id().clone(),@@ -6361,7 +6558,7 @@ where.construct_router_data(state,connector_id,- platform,+ platform.get_processor(),customer,&merchant_connector_account,None,@@ -6369,7 +6566,7 @@ where).await?;let gateway_context = gateway_context::RouterGatewayContext::direct(- platform.clone(),+ platform.get_processor().clone(),merchant_connector_account.clone(),business_profile.merchant_id.clone(),business_profile.get_id().clone(),@@ -6492,7 +6689,7 @@ where.construct_router_data(state,connector_id,- platform,+ platform.get_processor(),customer,&merchant_connector_account,None,@@ -6600,7 +6797,7 @@ where{let (execution_path, updated_state) = should_call_unified_connector_service(state,- platform,+ platform.get_processor(),&router_data,None, // No previous gateway information required for session flowcall_connector_action.clone(),@@ -6622,7 +6819,7 @@ wherelet gateway_context = gateway_context::RouterGatewayContext {creds_identifier,- platform: platform.clone(),+ processor: platform.get_processor().clone(),header_payload: header_payload.clone(),lineage_ids,merchant_connector_account: merchant_connector_account.clone(),@@ -6817,7 +7014,7 @@ pub fn validate_customer_details_for_click_to_pay(pub async fn call_create_connector_customer_if_required<F, Req, D>(state: &SessionState,customer: &Option<domain::Customer>,- platform: &domain::Platform,+ processor: &domain::Processor,merchant_connector_account: &helpers::MerchantConnectorAccountType,payment_data: &mut D,access_token: Option<&AccessToken>,@@ -6890,7 +7087,7 @@ where.construct_router_data(state,connector.connector.id(),- platform,+ processor,customer,merchant_connector_account,None,@@ -6931,7 +7128,7 @@ wherepub async fn call_create_connector_customer_if_required<F, Req, D>(state: &SessionState,customer: &Option<domain::Customer>,- platform: &domain::Platform,+ processor: &domain::Processor,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,payment_data: &mut D,) -> RouterResult<Option<storage::CustomerUpdate>>@@ -6952,7 +7149,7 @@ wherelet profile_id = payment_data.get_payment_intent().profile_id.clone();let default_gateway_context = gateway_context::RouterGatewayContext::direct(- platform.clone(),+ processor.clone(),merchant_connector_account.clone(),payment_data.get_payment_intent().merchant_id.clone(),profile_id,@@ -6981,7 +7178,7 @@ where.construct_router_data(state,connector.connector.id(),- platform,+ processor,customer,merchant_connector_account,None,@@ -7285,7 +7482,7 @@ where#[allow(clippy::too_many_arguments)]async fn complete_postprocessing_steps_if_required<F, Q, RouterDReq, D>(state: &SessionState,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_conn_account: &helpers::MerchantConnectorAccountType,connector: &api::ConnectorData,@@ -7307,7 +7504,7 @@ where.construct_router_data(state,connector.connector.id(),- platform,+ processor,customer,merchant_conn_account,None,diff --git a/crates/router/src/core/payments/flows.rs b/crates/router/src/core/payments/flows.rsindex a9ff9e668b..754593d9b8 100644--- a/crates/router/src/core/payments/flows.rs+++ b/crates/router/src/core/payments/flows.rs@@ -48,7 +48,7 @@ pub trait ConstructFlowSpecificData<F, Req, Res> {&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -62,7 +62,7 @@ pub trait ConstructFlowSpecificData<F, Req, Res> {&self,_state: &SessionState,_connector_id: &str,- _platform: &domain::Platform,+ _processor: &domain::Processor,_customer: &Option<domain::Customer>,_merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,_merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -123,7 +123,7 @@ pub trait Feature<F, T> {&self,state: &SessionState,connector: &api::ConnectorData,- platform: &domain::Platform,+ processor: &domain::Processor,creds_identifier: Option<&str>,gateway_context: &gateway_context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult>@@ -299,7 +299,7 @@ pub trait Feature<F, T> {_lineage_ids: grpc_client::LineageIds,_merchant_connector_account: domain::MerchantConnectorAccountTypeDetails,_external_vault_merchant_connector_account: domain::MerchantConnectorAccountTypeDetails,- _platform: &domain::Platform,+ _processor: &domain::Processor,_unified_connector_service_execution_mode: common_enums::ExecutionMode,_merchant_order_reference_id: Option<String>,) -> RouterResult<()>diff --git a/crates/router/src/core/payments/flows/approve_flow.rs b/crates/router/src/core/payments/flows/approve_flow.rsindex 67ba0f0980..21a037c129 100644--- a/crates/router/src/core/payments/flows/approve_flow.rs+++ b/crates/router/src/core/payments/flows/approve_flow.rs@@ -23,7 +23,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -37,7 +37,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -52,7 +52,7 @@ implstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -89,7 +89,7 @@ impl Feature<api::Approve, types::PaymentsApproveData>&self,state: &SessionState,connector: &api::ConnectorData,- _platform: &domain::Platform,+ _processor: &domain::Processor,creds_identifier: Option<&str>,gateway_context: &gateway_context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult> {diff --git a/crates/router/src/core/payments/flows/authorize_flow.rs b/crates/router/src/core/payments/flows/authorize_flow.rsindex 9625f33272..d6ac85f27f 100644--- a/crates/router/src/core/payments/flows/authorize_flow.rs+++ b/crates/router/src/core/payments/flows/authorize_flow.rs@@ -67,7 +67,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -83,7 +83,7 @@ implstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -132,7 +132,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -153,7 +153,7 @@ implstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -392,7 +392,7 @@ impl Feature<api::Authorize, types::PaymentsAuthorizeData> for types::PaymentsAu&self,state: &SessionState,connector: &api::ConnectorData,- _platform: &domain::Platform,+ _processor: &domain::Processor,creds_identifier: Option<&str>,gateway_context: &gateway_context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult> {@@ -1271,7 +1271,7 @@ pub async fn call_unified_connector_service_pre_authenticate(lineage_ids: grpc_client::LineageIds,#[cfg(feature = "v1")] merchant_connector_account: helpers::MerchantConnectorAccountType,#[cfg(feature = "v2")] merchant_connector_account: domain::MerchantConnectorAccountTypeDetails,- platform: &domain::Platform,+ processor: &domain::Processor,connector: enums::connector_enums::Connector,unified_connector_service_execution_mode: enums::ExecutionMode,merchant_order_reference_id: Option<String>,@@ -1300,7 +1300,7 @@ pub async fn call_unified_connector_service_pre_authenticate(let connector_auth_metadata = build_unified_connector_service_auth_metadata(merchant_connector_account,- platform,+ processor,router_data.connector.clone(),).change_context(interface_errors::ConnectorError::RequestEncodingFailed)diff --git a/crates/router/src/core/payments/flows/cancel_flow.rs b/crates/router/src/core/payments/flows/cancel_flow.rsindex 2cd162730a..e5b2f84aab 100644--- a/crates/router/src/core/payments/flows/cancel_flow.rs+++ b/crates/router/src/core/payments/flows/cancel_flow.rs@@ -19,7 +19,7 @@ impl ConstructFlowSpecificData<api::Void, types::PaymentsCancelData, types::Paym&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -34,7 +34,7 @@ impl ConstructFlowSpecificData<api::Void, types::PaymentsCancelData, types::Paymstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -54,7 +54,7 @@ impl ConstructFlowSpecificData<api::Void, types::PaymentsCancelData, types::Paym&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -64,7 +64,7 @@ impl ConstructFlowSpecificData<api::Void, types::PaymentsCancelData, types::Paymstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -118,7 +118,7 @@ impl Feature<api::Void, types::PaymentsCancelData>&self,state: &SessionState,connector: &api::ConnectorData,- _platform: &domain::Platform,+ _processor: &domain::Processor,creds_identifier: Option<&str>,gateway_context: &payments::gateway::context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult> {diff --git a/crates/router/src/core/payments/flows/cancel_post_capture_flow.rs b/crates/router/src/core/payments/flows/cancel_post_capture_flow.rsindex 4a33d67429..a76da0de20 100644--- a/crates/router/src/core/payments/flows/cancel_post_capture_flow.rs+++ b/crates/router/src/core/payments/flows/cancel_post_capture_flow.rs@@ -24,7 +24,7 @@ impl&self,_state: &SessionState,_connector_id: &str,- _platform: &domain::Platform,+ _processor: &domain::Processor,_customer: &Option<domain::Customer>,_merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,_merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -38,7 +38,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -53,7 +53,7 @@ implstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -113,7 +113,7 @@ impl Feature<api::PostCaptureVoid, types::PaymentsCancelPostCaptureData>&self,state: &SessionState,connector: &api::ConnectorData,- _platform: &domain::Platform,+ _processor: &domain::Processor,creds_identifier: Option<&str>,gateway_context: &payments::gateway::context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult> {diff --git a/crates/router/src/core/payments/flows/capture_flow.rs b/crates/router/src/core/payments/flows/capture_flow.rsindex af7e0a235a..03197e67a0 100644--- a/crates/router/src/core/payments/flows/capture_flow.rs+++ b/crates/router/src/core/payments/flows/capture_flow.rs@@ -21,7 +21,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -36,7 +36,7 @@ implstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -58,7 +58,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -70,7 +70,7 @@ implstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -126,7 +126,7 @@ impl Feature<api::Capture, types::PaymentsCaptureData>&self,state: &SessionState,connector: &api::ConnectorData,- _platform: &domain::Platform,+ _processor: &domain::Processor,creds_identifier: Option<&str>,gateway_context: &payments::gateway::context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult> {diff --git a/crates/router/src/core/payments/flows/complete_authorize_flow.rs b/crates/router/src/core/payments/flows/complete_authorize_flow.rsindex 553bd2ecc5..0cd5e289c8 100644--- a/crates/router/src/core/payments/flows/complete_authorize_flow.rs+++ b/crates/router/src/core/payments/flows/complete_authorize_flow.rs@@ -50,7 +50,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -71,7 +71,7 @@ implstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -87,7 +87,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -291,7 +291,7 @@ impl Feature<api::CompleteAuthorize, types::CompleteAuthorizeData>&self,state: &SessionState,connector: &api::ConnectorData,- _platform: &domain::Platform,+ _processor: &domain::Processor,creds_identifier: Option<&str>,gateway_context: &gateway_context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult> {@@ -633,7 +633,7 @@ pub async fn call_unified_connector_service_authenticate(lineage_ids: grpc_client::LineageIds,#[cfg(feature = "v1")] merchant_connector_account: helpers::MerchantConnectorAccountType,#[cfg(feature = "v2")] merchant_connector_account: domain::MerchantConnectorAccountTypeDetails,- platform: &domain::Platform,+ processor: &domain::Processor,connector: connector_enums::Connector,unified_connector_service_execution_mode: common_enums::ExecutionMode,merchant_order_reference_id: Option<String>,@@ -662,7 +662,7 @@ pub async fn call_unified_connector_service_authenticate(let connector_auth_metadata = ucs_core::build_unified_connector_service_auth_metadata(merchant_connector_account,- platform,+ processor,router_data.connector.clone(),).change_context(interface_errors::ConnectorError::RequestEncodingFailed)@@ -756,7 +756,7 @@ pub async fn call_unified_connector_service_post_authenticate(lineage_ids: grpc_client::LineageIds,#[cfg(feature = "v1")] merchant_connector_account: helpers::MerchantConnectorAccountType,#[cfg(feature = "v2")] merchant_connector_account: domain::MerchantConnectorAccountTypeDetails,- platform: &domain::Platform,+ processor: &domain::Processor,unified_connector_service_execution_mode: common_enums::ExecutionMode,merchant_order_reference_id: Option<String>,) -> errors::CustomResult<@@ -784,7 +784,7 @@ pub async fn call_unified_connector_service_post_authenticate(let connector_auth_metadata = ucs_core::build_unified_connector_service_auth_metadata(merchant_connector_account,- platform,+ processor,router_data.connector.clone(),).change_context(interface_errors::ConnectorError::RequestEncodingFailed)diff --git a/crates/router/src/core/payments/flows/extend_authorization_flow.rs b/crates/router/src/core/payments/flows/extend_authorization_flow.rsindex 3dadf66abe..fae375e87e 100644--- a/crates/router/src/core/payments/flows/extend_authorization_flow.rs+++ b/crates/router/src/core/payments/flows/extend_authorization_flow.rs@@ -24,7 +24,7 @@ impl&self,_state: &SessionState,_connector_id: &str,- _platform: &domain::Platform,+ _processor: &domain::Processor,_customer: &Option<domain::Customer>,_merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,_merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -38,7 +38,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -53,7 +53,7 @@ implstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -113,7 +113,7 @@ impl Feature<api::ExtendAuthorization, types::PaymentsExtendAuthorizationData>&self,state: &SessionState,connector: &api::ConnectorData,- _platform: &domain::Platform,+ _processor: &domain::Processor,creds_identifier: Option<&str>,gateway_context: &payments::gateway::context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult> {diff --git a/crates/router/src/core/payments/flows/external_proxy_flow.rs b/crates/router/src/core/payments/flows/external_proxy_flow.rsindex 80fc62d00f..1c05545878 100644--- a/crates/router/src/core/payments/flows/external_proxy_flow.rs+++ b/crates/router/src/core/payments/flows/external_proxy_flow.rs@@ -49,7 +49,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -66,7 +66,7 @@ implstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -121,7 +121,7 @@ impl Feature<api::ExternalVaultProxy, types::ExternalVaultProxyPaymentsData>&self,state: &SessionState,connector: &api::ConnectorData,- _platform: &domain::Platform,+ _processor: &domain::Processor,creds_identifier: Option<&str>,gateway_context: &payments::gateway::context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult> {@@ -364,7 +364,7 @@ impl Feature<api::ExternalVaultProxy, types::ExternalVaultProxyPaymentsData>lineage_ids: grpc_client::LineageIds,merchant_connector_account: domain::MerchantConnectorAccountTypeDetails,external_vault_merchant_connector_account: domain::MerchantConnectorAccountTypeDetails,- platform: &domain::Platform,+ processor: &domain::Processor,unified_connector_service_execution_mode: enums::ExecutionMode,merchant_order_reference_id: Option<String>,) -> RouterResult<()> {@@ -383,7 +383,7 @@ impl Feature<api::ExternalVaultProxy, types::ExternalVaultProxyPaymentsData>let connector_auth_metadata =unified_connector_service::build_unified_connector_service_auth_metadata(merchant_connector_account,- platform,+ processor,self.connector.clone(),).change_context(ApiErrorResponse::InternalServerError)diff --git a/crates/router/src/core/payments/flows/incremental_authorization_flow.rs b/crates/router/src/core/payments/flows/incremental_authorization_flow.rsindex a722c6eefe..53af99b54a 100644--- a/crates/router/src/core/payments/flows/incremental_authorization_flow.rs+++ b/crates/router/src/core/payments/flows/incremental_authorization_flow.rs@@ -25,7 +25,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -40,7 +40,7 @@ implstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -56,7 +56,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -101,7 +101,7 @@ impl Feature<api::IncrementalAuthorization, types::PaymentsIncrementalAuthorizat&self,state: &SessionState,connector: &api::ConnectorData,- _platform: &domain::Platform,+ _processor: &domain::Processor,creds_identifier: Option<&str>,gateway_context: &payments::gateway::context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult> {diff --git a/crates/router/src/core/payments/flows/post_session_tokens_flow.rs b/crates/router/src/core/payments/flows/post_session_tokens_flow.rsindex 46d36a8881..afff0d84ba 100644--- a/crates/router/src/core/payments/flows/post_session_tokens_flow.rs+++ b/crates/router/src/core/payments/flows/post_session_tokens_flow.rs@@ -24,7 +24,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -39,7 +39,7 @@ implstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -55,7 +55,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -107,7 +107,7 @@ impl Feature<api::PostSessionTokens, types::PaymentsPostSessionTokensData>&self,state: &SessionState,connector: &api::ConnectorData,- _platform: &domain::Platform,+ _processor: &domain::Processor,creds_identifier: Option<&str>,gateway_context: &payments::gateway::context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult> {diff --git a/crates/router/src/core/payments/flows/psync_flow.rs b/crates/router/src/core/payments/flows/psync_flow.rsindex cf3266e1d2..62f2f771d4 100644--- a/crates/router/src/core/payments/flows/psync_flow.rs+++ b/crates/router/src/core/payments/flows/psync_flow.rs@@ -26,7 +26,7 @@ impl ConstructFlowSpecificData<api::PSync, types::PaymentsSyncData, types::Payme&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -43,7 +43,7 @@ impl ConstructFlowSpecificData<api::PSync, types::PaymentsSyncData, types::Paymestate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -64,7 +64,7 @@ impl ConstructFlowSpecificData<api::PSync, types::PaymentsSyncData, types::Payme&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -76,7 +76,7 @@ impl ConstructFlowSpecificData<api::PSync, types::PaymentsSyncData, types::Paymestate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -168,7 +168,7 @@ impl Feature<api::PSync, types::PaymentsSyncData>&self,state: &SessionState,connector: &api::ConnectorData,- _platform: &domain::Platform,+ _processor: &domain::Processor,creds_identifier: Option<&str>,gateway_context: &payments::gateway::context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult> {diff --git a/crates/router/src/core/payments/flows/reject_flow.rs b/crates/router/src/core/payments/flows/reject_flow.rsindex 7e82a97057..89ba68ddd0 100644--- a/crates/router/src/core/payments/flows/reject_flow.rs+++ b/crates/router/src/core/payments/flows/reject_flow.rs@@ -20,7 +20,7 @@ impl ConstructFlowSpecificData<api::Reject, types::PaymentsRejectData, types::Pa&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -35,7 +35,7 @@ impl ConstructFlowSpecificData<api::Reject, types::PaymentsRejectData, types::Pastate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -51,7 +51,7 @@ impl ConstructFlowSpecificData<api::Reject, types::PaymentsRejectData, types::Pa&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -86,7 +86,7 @@ impl Feature<api::Reject, types::PaymentsRejectData>&self,state: &SessionState,connector: &api::ConnectorData,- _platform: &domain::Platform,+ _processor: &domain::Processor,creds_identifier: Option<&str>,gateway_context: &payments::gateway::context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult> {diff --git a/crates/router/src/core/payments/flows/session_flow.rs b/crates/router/src/core/payments/flows/session_flow.rsindex e2af3902c6..4a7e309e5f 100644--- a/crates/router/src/core/payments/flows/session_flow.rs+++ b/crates/router/src/core/payments/flows/session_flow.rs@@ -44,7 +44,7 @@ impl&self,state: &routes::SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -54,7 +54,7 @@ implstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -74,7 +74,7 @@ impl&self,state: &routes::SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -89,7 +89,7 @@ implstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -134,7 +134,7 @@ impl Feature<api::Session, types::PaymentsSessionData> for types::PaymentsSessio&self,state: &routes::SessionState,connector: &api::ConnectorData,- _platform: &domain::Platform,+ _processor: &domain::Processor,creds_identifier: Option<&str>,gateway_context: &gateway_context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult> {diff --git a/crates/router/src/core/payments/flows/session_update_flow.rs b/crates/router/src/core/payments/flows/session_update_flow.rsindex 070fb20ad9..d60c4baa03 100644--- a/crates/router/src/core/payments/flows/session_update_flow.rs+++ b/crates/router/src/core/payments/flows/session_update_flow.rs@@ -24,7 +24,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,_merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -40,7 +40,7 @@ implstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,),@@ -53,7 +53,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,_merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -105,7 +105,7 @@ impl Feature<api::SdkSessionUpdate, types::SdkPaymentsSessionUpdateData>&self,state: &SessionState,connector: &api::ConnectorData,- _platform: &domain::Platform,+ _processor: &domain::Processor,creds_identifier: Option<&str>,gateway_context: &payments::gateway::context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult> {diff --git a/crates/router/src/core/payments/flows/setup_mandate_flow.rs b/crates/router/src/core/payments/flows/setup_mandate_flow.rsindex 9d6a8d3438..1a5cd26c66 100644--- a/crates/router/src/core/payments/flows/setup_mandate_flow.rs+++ b/crates/router/src/core/payments/flows/setup_mandate_flow.rs@@ -42,7 +42,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -57,7 +57,7 @@ implstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -82,7 +82,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -93,7 +93,7 @@ implstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -275,7 +275,7 @@ impl Feature<api::SetupMandate, types::SetupMandateRequestData> for types::Setup&self,state: &SessionState,connector: &api::ConnectorData,- _platform: &domain::Platform,+ _processor: &domain::Processor,creds_identifier: Option<&str>,gateway_context: &gateway_context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult> {diff --git a/crates/router/src/core/payments/flows/update_metadata_flow.rs b/crates/router/src/core/payments/flows/update_metadata_flow.rsindex 5eb6878f2c..597c3ebaab 100644--- a/crates/router/src/core/payments/flows/update_metadata_flow.rs+++ b/crates/router/src/core/payments/flows/update_metadata_flow.rs@@ -24,7 +24,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -37,7 +37,7 @@ implstate,self.clone(),connector_id,- platform,+ processor,customer,merchant_connector_account,merchant_recipient_data,@@ -52,7 +52,7 @@ impl&self,state: &SessionState,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -104,7 +104,7 @@ impl Feature<api::UpdateMetadata, types::PaymentsUpdateMetadataData>&self,state: &SessionState,connector: &api::ConnectorData,- _platform: &domain::Platform,+ _processor: &domain::Processor,creds_identifier: Option<&str>,gateway_context: &payments::gateway::context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult> {diff --git a/crates/router/src/core/payments/gateway/access_token_gateway.rs b/crates/router/src/core/payments/gateway/access_token_gateway.rsindex 9dc4ef8704..aaab001869 100644--- a/crates/router/src/core/payments/gateway/access_token_gateway.rs+++ b/crates/router/src/core/payments/gateway/access_token_gateway.rs@@ -75,7 +75,7 @@ whereConnectorError,> {let merchant_connector_account = context.merchant_connector_account;- let platform = context.platform;+ let processor = &context.processor;let lineage_ids = context.lineage_ids;let header_payload = context.header_payload;let unified_connector_service_execution_mode = context.execution_mode;@@ -98,7 +98,7 @@ wherelet connector_auth_metadata =unified_connector_service::build_unified_connector_service_auth_metadata(merchant_connector_account.clone(),- &platform,+ processor,router_data.connector.clone(),).change_context(ConnectorError::RequestEncodingFailed)diff --git a/crates/router/src/core/payments/gateway/authenticate_gateway.rs b/crates/router/src/core/payments/gateway/authenticate_gateway.rsindex 186162711c..e4a827fea0 100644--- a/crates/router/src/core/payments/gateway/authenticate_gateway.rs+++ b/crates/router/src/core/payments/gateway/authenticate_gateway.rs@@ -71,7 +71,7 @@ whereConnectorError,> {let merchant_connector_account = context.merchant_connector_account;- let platform = context.platform;+ let processor = &context.processor;let lineage_ids = context.lineage_ids;let header_payload = context.header_payload;let unified_connector_service_execution_mode = context.execution_mode;@@ -86,7 +86,7 @@ where&header_payload,lineage_ids,merchant_connector_account,- &platform,+ processor,connector_enum,unified_connector_service_execution_mode,merchant_order_reference_id,diff --git a/crates/router/src/core/payments/gateway/authorize_gateway.rs b/crates/router/src/core/payments/gateway/authorize_gateway.rsindex 711af43a97..c6aa559731 100644--- a/crates/router/src/core/payments/gateway/authorize_gateway.rs+++ b/crates/router/src/core/payments/gateway/authorize_gateway.rs@@ -67,7 +67,7 @@ whereConnectorError,> {let merchant_connector_account = context.merchant_connector_account;- let platform = context.platform;+ let processor = &context.processor;let lineage_ids = context.lineage_ids;let header_payload = context.header_payload;let unified_connector_service_execution_mode = context.execution_mode;@@ -89,7 +89,7 @@ wherelet connector_auth_metadata =unified_connector_service::build_unified_connector_service_auth_metadata(merchant_connector_account,- &platform,+ processor,router_data.connector.clone(),).change_context(ConnectorError::RequestEncodingFailed)diff --git a/crates/router/src/core/payments/gateway/cancel_gateway.rs b/crates/router/src/core/payments/gateway/cancel_gateway.rsindex f3f13ea36e..25124bce24 100644--- a/crates/router/src/core/payments/gateway/cancel_gateway.rs+++ b/crates/router/src/core/payments/gateway/cancel_gateway.rs@@ -60,7 +60,7 @@ whereConnectorError,> {let merchant_connector_account = context.merchant_connector_account;- let platform = &context.platform;+ let processor = &context.processor;let lineage_ids = context.lineage_ids;let header_payload = context.header_payload;let unified_connector_service_execution_mode = context.execution_mode;@@ -80,7 +80,7 @@ wherelet connector_auth_metadata =unified_connector_service::build_unified_connector_service_auth_metadata(merchant_connector_account,- platform,+ processor,router_data.connector.clone(),).change_context(ConnectorError::RequestEncodingFailed)diff --git a/crates/router/src/core/payments/gateway/capture_gateway.rs b/crates/router/src/core/payments/gateway/capture_gateway.rsindex 4348a3534d..25df563df8 100644--- a/crates/router/src/core/payments/gateway/capture_gateway.rs+++ b/crates/router/src/core/payments/gateway/capture_gateway.rs@@ -60,7 +60,7 @@ whereConnectorError,> {let merchant_connector_account = context.merchant_connector_account;- let platform = &context.platform;+ let processor = &context.processor;let lineage_ids = context.lineage_ids;let header_payload = context.header_payload;let unified_connector_service_execution_mode = context.execution_mode;@@ -80,7 +80,7 @@ wherelet connector_auth_metadata =unified_connector_service::build_unified_connector_service_auth_metadata(merchant_connector_account,- platform,+ processor,router_data.connector.clone(),).change_context(ConnectorError::RequestEncodingFailed)diff --git a/crates/router/src/core/payments/gateway/complete_authorize_gateway.rs b/crates/router/src/core/payments/gateway/complete_authorize_gateway.rsindex 6130e55250..b4cc05c85c 100644--- a/crates/router/src/core/payments/gateway/complete_authorize_gateway.rs+++ b/crates/router/src/core/payments/gateway/complete_authorize_gateway.rs@@ -64,7 +64,7 @@ whereConnectorError,> {let merchant_connector_account = context.merchant_connector_account;- let platform = context.platform;+ let processor = &context.processor;let lineage_ids = context.lineage_ids;let header_payload = context.header_payload;let unified_connector_service_execution_mode = context.execution_mode;@@ -87,7 +87,7 @@ wherelet connector_auth_metadata =unified_connector_service::build_unified_connector_service_auth_metadata(merchant_connector_account,- &platform,+ processor,router_data.connector.clone(),).change_context(ConnectorError::RequestEncodingFailed)diff --git a/crates/router/src/core/payments/gateway/context.rs b/crates/router/src/core/payments/gateway/context.rsindex da2be220fb..9cfc19ad5f 100644--- a/crates/router/src/core/payments/gateway/context.rs+++ b/crates/router/src/core/payments/gateway/context.rs@@ -7,7 +7,7 @@use common_enums::{ExecutionMode, ExecutionPath, GatewaySystem};use common_utils::id_type;use external_services::grpc_client::LineageIds;-use hyperswitch_domain_models::{business_profile, payments::HeaderPayload, platform::Platform};+use hyperswitch_domain_models::{business_profile, payments::HeaderPayload, platform::Processor};use hyperswitch_interfaces::api::gateway::GatewayContext;use crate::core::payments::helpers;@@ -19,8 +19,8 @@ use crate::core::payments::helpers;#[derive(Clone, Debug)]pub struct RouterGatewayContext {pub creds_identifier: Option<String>,- /// Merchant context (merchant_id, profile_id, etc.)- pub platform: Platform,+ /// Processor context for payment execution+ pub processor: Processor,/// Header payload (x-reference-id, etc.)pub header_payload: HeaderPayload,@@ -46,7 +46,7 @@ pub struct RouterGatewayContext {impl RouterGatewayContext {pub fn new(- platform: Platform,+ processor: Processor,header_payload: HeaderPayload,business_profile: &business_profile::Profile,#[cfg(feature = "v1")] merchant_connector_account: helpers::MerchantConnectorAccountType,@@ -66,7 +66,7 @@ impl RouterGatewayContext {ExecutionPath::Direct => ExecutionMode::NotApplicable,};Self {- platform,+ processor,header_payload,lineage_ids,merchant_connector_account,@@ -76,7 +76,7 @@ impl RouterGatewayContext {}}pub fn direct(- platform: Platform,+ processor: Processor,#[cfg(feature = "v1")] merchant_connector_account: helpers::MerchantConnectorAccountType,#[cfg(feature = "v2")]merchant_connector_account: hyperswitch_domain_models::merchant_connector_account::MerchantConnectorAccountTypeDetails,@@ -86,7 +86,7 @@ impl RouterGatewayContext {) -> Self {let lineage_ids = LineageIds::new(merchant_id, profile_id);Self {- platform,+ processor,header_payload: HeaderPayload::default(),lineage_ids,merchant_connector_account,diff --git a/crates/router/src/core/payments/gateway/create_customer_gateway.rs b/crates/router/src/core/payments/gateway/create_customer_gateway.rsindex 39aa200b71..47059bcc1e 100644--- a/crates/router/src/core/payments/gateway/create_customer_gateway.rs+++ b/crates/router/src/core/payments/gateway/create_customer_gateway.rs@@ -69,7 +69,7 @@ wherelet _connector_enum = common_enums::connector_enums::Connector::from_str(&connector_name).change_context(ConnectorError::InvalidConnectorName)?;let merchant_connector_account = context.merchant_connector_account;- let platform = context.platform;+ let processor = &context.processor;let lineage_ids = context.lineage_ids;let unified_connector_service_execution_mode = context.execution_mode;@@ -91,7 +91,7 @@ wherelet connector_auth_metadata =unified_connector_service::build_unified_connector_service_auth_metadata(merchant_connector_account,- &platform,+ processor,router_data.connector.clone(),).change_context(ConnectorError::RequestEncodingFailed)diff --git a/crates/router/src/core/payments/gateway/create_order_gateway.rs b/crates/router/src/core/payments/gateway/create_order_gateway.rsindex 898c12f84e..f78f8199d1 100644--- a/crates/router/src/core/payments/gateway/create_order_gateway.rs+++ b/crates/router/src/core/payments/gateway/create_order_gateway.rs@@ -65,7 +65,7 @@ whereConnectorError,> {let merchant_connector_account = context.merchant_connector_account;- let platform = context.platform;+ let processor = &context.processor;let lineage_ids = context.lineage_ids;let header_payload = context.header_payload;let unified_connector_service_execution_mode = context.execution_mode;@@ -85,7 +85,7 @@ wherelet connector_auth_metadata =unified_connector_service::build_unified_connector_service_auth_metadata(merchant_connector_account,- &platform,+ processor,router_data.connector.clone(),).change_context(ConnectorError::RequestEncodingFailed)diff --git a/crates/router/src/core/payments/gateway/incremental_authorization_gateway.rs b/crates/router/src/core/payments/gateway/incremental_authorization_gateway.rsindex 016e7706b9..a328f881ba 100644--- a/crates/router/src/core/payments/gateway/incremental_authorization_gateway.rs+++ b/crates/router/src/core/payments/gateway/incremental_authorization_gateway.rs@@ -73,7 +73,7 @@ whereConnectorError,> {let merchant_connector_account = context.merchant_connector_account;- let platform = context.platform;+ let processor = context.processor;let lineage_ids = context.lineage_ids;let header_payload = context.header_payload;let unified_connector_service_execution_mode = context.execution_mode;@@ -95,7 +95,7 @@ wherelet connector_auth_metadata =unified_connector_service::build_unified_connector_service_auth_metadata(merchant_connector_account,- &platform,+ &processor,router_data.connector.clone(),).change_context(ConnectorError::RequestEncodingFailed)diff --git a/crates/router/src/core/payments/gateway/payment_method_token_create_gateway.rs b/crates/router/src/core/payments/gateway/payment_method_token_create_gateway.rsindex 7f90cd2b3d..64031f00f7 100644--- a/crates/router/src/core/payments/gateway/payment_method_token_create_gateway.rs+++ b/crates/router/src/core/payments/gateway/payment_method_token_create_gateway.rs@@ -71,7 +71,7 @@ whereConnectorError,> {let merchant_connector_account = context.merchant_connector_account;- let platform = context.platform;+ let processor = &context.processor;let lineage_ids = context.lineage_ids;let header_payload = context.header_payload;let unified_connector_service_execution_mode = context.execution_mode;@@ -93,7 +93,7 @@ wherelet connector_auth_metadata =unified_connector_service::build_unified_connector_service_auth_metadata(merchant_connector_account,- &platform,+ processor,router_data.connector.clone(),).change_context(ConnectorError::RequestEncodingFailed)diff --git a/crates/router/src/core/payments/gateway/post_authenticate_gateway.rs b/crates/router/src/core/payments/gateway/post_authenticate_gateway.rsindex 15b767c407..ad32959b79 100644--- a/crates/router/src/core/payments/gateway/post_authenticate_gateway.rs+++ b/crates/router/src/core/payments/gateway/post_authenticate_gateway.rs@@ -68,7 +68,7 @@ whereConnectorError,> {let merchant_connector_account = context.merchant_connector_account;- let platform = context.platform;+ let processor = &context.processor;let lineage_ids = context.lineage_ids;let header_payload = context.header_payload;let unified_connector_service_execution_mode = context.execution_mode;@@ -79,7 +79,7 @@ where&header_payload,lineage_ids,merchant_connector_account,- &platform,+ processor,unified_connector_service_execution_mode,merchant_order_reference_id,)diff --git a/crates/router/src/core/payments/gateway/pre_authenticate_gateway.rs b/crates/router/src/core/payments/gateway/pre_authenticate_gateway.rsindex c9febe38e6..935925a172 100644--- a/crates/router/src/core/payments/gateway/pre_authenticate_gateway.rs+++ b/crates/router/src/core/payments/gateway/pre_authenticate_gateway.rs@@ -62,7 +62,7 @@ whereConnectorError,> {let merchant_connector_account = context.merchant_connector_account;- let platform = context.platform;+ let processor = &context.processor;let lineage_ids = context.lineage_ids;let header_payload = context.header_payload;let unified_connector_service_execution_mode = context.execution_mode;@@ -77,7 +77,7 @@ where&header_payload,lineage_ids,merchant_connector_account,- &platform,+ processor,connector_enum,unified_connector_service_execution_mode,merchant_order_reference_id,diff --git a/crates/router/src/core/payments/gateway/psync_gateway.rs b/crates/router/src/core/payments/gateway/psync_gateway.rsindex 9a2c7b79b4..924da4d143 100644--- a/crates/router/src/core/payments/gateway/psync_gateway.rs+++ b/crates/router/src/core/payments/gateway/psync_gateway.rs@@ -69,7 +69,7 @@ where.change_context(ConnectorError::InvalidConnectorName)?;let merchant_connector_account = context.merchant_connector_account;let creds_identifier = context.creds_identifier;- let platform = context.platform;+ let processor = &context.processor;let lineage_ids = context.lineage_ids;let header_payload = context.header_payload;let unified_connector_service_execution_mode = context.execution_mode;@@ -111,7 +111,7 @@ wherelet connector_auth_metadata =unified_connector_service::build_unified_connector_service_auth_metadata(merchant_connector_account,- &platform,+ processor,router_data.connector.clone(),).change_context(ConnectorError::RequestEncodingFailed)@@ -155,7 +155,7 @@ whereif let Some(access_token) =unified_connector_service::get_access_token_from_ucs_response(state,- &platform,+ processor,&connector_name,merchant_connector_id.as_ref(),creds_identifier.clone(),@@ -165,7 +165,7 @@ where{if let Err(error) = unified_connector_service::set_access_token_for_ucs(state,- &platform,+ processor,&connector_name,access_token,merchant_connector_id.as_ref(),diff --git a/crates/router/src/core/payments/gateway/session_gateway.rs b/crates/router/src/core/payments/gateway/session_gateway.rsindex 42b1986cd0..a9a0efadcb 100644--- a/crates/router/src/core/payments/gateway/session_gateway.rs+++ b/crates/router/src/core/payments/gateway/session_gateway.rs@@ -65,7 +65,7 @@ whereConnectorError,> {let merchant_connector_account = context.merchant_connector_account;- let platform = context.platform;+ let processor = &context.processor;let lineage_ids = context.lineage_ids;let header_payload = context.header_payload;let unified_connector_service_execution_mode = context.execution_mode;@@ -85,7 +85,7 @@ wherelet connector_auth_metadata =unified_connector_service::build_unified_connector_service_auth_metadata(merchant_connector_account,- &platform,+ processor,router_data.connector.clone(),).change_context(ConnectorError::RequestEncodingFailed)diff --git a/crates/router/src/core/payments/gateway/session_token_gateway.rs b/crates/router/src/core/payments/gateway/session_token_gateway.rsindex deeda29212..4abe8e89ca 100644--- a/crates/router/src/core/payments/gateway/session_token_gateway.rs+++ b/crates/router/src/core/payments/gateway/session_token_gateway.rs@@ -67,7 +67,7 @@ whereConnectorError,> {let merchant_connector_account = context.merchant_connector_account;- let platform = context.platform;+ let processor = &context.processor;let lineage_ids = context.lineage_ids;let header_payload = context.header_payload;let unified_connector_service_execution_mode = context.execution_mode;@@ -88,7 +88,7 @@ wherelet connector_auth_metadata =unified_connector_service::build_unified_connector_service_auth_metadata(merchant_connector_account,- &platform,+ processor,router_data.connector.clone(),).change_context(ConnectorError::RequestEncodingFailed)diff --git a/crates/router/src/core/payments/gateway/setup_mandate.rs b/crates/router/src/core/payments/gateway/setup_mandate.rsindex 484d8bfc97..36bd5a5992 100644--- a/crates/router/src/core/payments/gateway/setup_mandate.rs+++ b/crates/router/src/core/payments/gateway/setup_mandate.rs@@ -63,7 +63,7 @@ whereConnectorError,> {let merchant_connector_account = context.merchant_connector_account;- let platform = context.platform;+ let processor = &context.processor;let lineage_ids = context.lineage_ids;let header_payload = context.header_payload;let unified_connector_service_execution_mode = context.execution_mode;@@ -83,7 +83,7 @@ wherelet connector_auth_metadata =unified_connector_service::build_unified_connector_service_auth_metadata(merchant_connector_account,- &platform,+ processor,router_data.connector.clone(),).change_context(ConnectorError::RequestEncodingFailed)diff --git a/crates/router/src/core/payments/retry.rs b/crates/router/src/core/payments/retry.rsindex 678d9f8e29..5024412cbe 100644--- a/crates/router/src/core/payments/retry.rs+++ b/crates/router/src/core/payments/retry.rs@@ -14,7 +14,7 @@ use crate::{core::{errors::{self, RouterResult, StorageErrorExt},payments::{- self,+ self, complete_connector_service,flows::{ConstructFlowSpecificData, Feature},operations,},@@ -402,29 +402,54 @@ where).await?;- let (router_data, _mca) = payments::decide_unified_connector_service_call(- state,- req_state,- platform,- connector.clone(),+ let (updated_customer, call_connector_service_response, updated_state) =+ payments::decide_unified_connector_service_call(+ state,+ platform.get_processor(),+ connector.clone(),+ operation,+ payment_data,+ customer,+ payments::CallConnectorAction::Trigger,+ None,+ validate_result,+ schedule_time,+ hyperswitch_domain_models::payments::HeaderPayload::default(),+ business_profile,+ true,+ merchant_connector_account.clone(),+ router_data,+ tokenization_action,+ )+ .await?;+ // Update customer at provider level after connector operations complete+ operation+ .to_domain()?+ .update_customer(+ &updated_state,+ platform.get_provider(),+ customer.clone(),+ updated_customer,+ )+ .await?;++ let (router_data, _mca) = complete_connector_service(+ &updated_state,+ platform.get_processor(),operation,payment_data,customer,- payments::CallConnectorAction::Trigger,- None,- validate_result,- schedule_time,- hyperswitch_domain_models::payments::HeaderPayload::default(),- frm_suggestion,business_profile,- true,None,+ connector,+ payments::CallConnectorAction::Trigger,merchant_connector_account,- router_data,- tokenization_action,+ req_state.clone(),+ hyperswitch_domain_models::payments::HeaderPayload::default(),+ frm_suggestion,+ call_connector_service_response,).await?;-Ok(router_data)}diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rsindex e2aee47420..e787b96c3a 100644--- a/crates/router/src/core/payments/transformers.rs+++ b/crates/router/src/core/payments/transformers.rs@@ -79,7 +79,7 @@ pub async fn construct_router_data_to_update_calculated_tax<'a, F, T>(state: &'a SessionState,payment_data: PaymentData<F>,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &'a Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,) -> RouterResult<types::RouterData<F, T, types::PaymentsResponseData>>@@ -98,7 +98,7 @@ pub async fn construct_router_data_to_update_calculated_tax<'a, F, T>(state: &'a SessionState,payment_data: PaymentData<F>,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &'a Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,) -> RouterResult<types::RouterData<F, T, types::PaymentsResponseData>>@@ -137,7 +137,7 @@ wherelet router_data = types::RouterData {flow: PhantomData,- merchant_id: platform.get_processor().get_account().get_id().clone(),+ merchant_id: processor.get_account().get_id().clone(),customer_id: None,connector: connector_id.to_owned(),payment_id: payment_data@@ -172,7 +172,7 @@ whererecurring_mandate_payment_data: None,connector_request_reference_id: core_utils::get_connector_request_reference_id(&state.conf,- platform.get_processor(),+ processor,&payment_data.payment_intent,&payment_data.payment_attempt,connector_id,@@ -299,7 +299,7 @@ pub async fn construct_payment_router_data_for_authorize<'a>(state: &'a SessionState,payment_data: hyperswitch_domain_models::payments::PaymentConfirmData<api::Authorize>,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &'a Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,_merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -358,11 +358,7 @@ pub async fn construct_payment_router_data_for_authorize<'a>(.payment_intent.create_finish_redirection_url(router_base_url,- platform- .get_processor()- .get_account()- .publishable_key- .as_ref(),+ processor.get_account().publishable_key.as_ref(),).change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Unable to construct finish redirection url")?@@ -478,7 +474,7 @@ pub async fn construct_payment_router_data_for_authorize<'a>(// TODO: evaluate the fields in router data, if they are required or notlet router_data = types::RouterData {flow: PhantomData,- merchant_id: platform.get_processor().get_account().get_id().clone(),+ merchant_id: processor.get_account().get_id().clone(),tenant_id: state.tenant.tenant_id.clone(),// TODO: evaluate why we need customer id at the connector level. We already have connector customer id.customer_id,@@ -566,7 +562,7 @@ pub async fn construct_external_vault_proxy_payment_router_data<'a>(state: &'a SessionState,payment_data: hyperswitch_domain_models::payments::PaymentConfirmData<api::ExternalVaultProxy>,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &'a Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,_merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -625,11 +621,7 @@ pub async fn construct_external_vault_proxy_payment_router_data<'a>(.payment_intent.create_finish_redirection_url(router_base_url,- platform- .get_processor()- .get_account()- .publishable_key- .as_ref(),+ processor.get_account().publishable_key.as_ref(),).change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Unable to construct finish redirection url")?@@ -718,7 +710,7 @@ pub async fn construct_external_vault_proxy_payment_router_data<'a>(// Construct RouterDataV2 for external vault proxylet router_data_v2 = construct_external_vault_proxy_router_data_v2(state,- platform.get_processor().get_account(),+ processor.get_account(),merchant_connector_account,&payment_data,request,@@ -746,7 +738,7 @@ pub async fn construct_payment_router_data_for_capture<'a>(state: &'a SessionState,payment_data: hyperswitch_domain_models::payments::PaymentCaptureData<api::Capture>,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &'a Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,_merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -831,7 +823,7 @@ pub async fn construct_payment_router_data_for_capture<'a>(// TODO: evaluate the fields in router data, if they are required or notlet router_data = types::RouterData {flow: PhantomData,- merchant_id: platform.get_processor().get_account().get_id().clone(),+ merchant_id: processor.get_account().get_id().clone(),// TODO: evaluate why we need customer id at the connector level. We already have connector customer id.customer_id,connector: connector_id.to_owned(),@@ -917,7 +909,7 @@ pub async fn construct_router_data_for_psync<'a>(state: &'a SessionState,payment_data: hyperswitch_domain_models::payments::PaymentStatusData<api::PSync>,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &'a Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,_merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -974,7 +966,7 @@ pub async fn construct_router_data_for_psync<'a>(// TODO: evaluate the fields in router data, if they are required or notlet router_data = types::RouterData {flow: PhantomData,- merchant_id: platform.get_processor().get_account().get_id().clone(),+ merchant_id: processor.get_account().get_id().clone(),// TODO: evaluate why we need customer id at the connector level. We already have connector customer id.customer_id,tenant_id: state.tenant.tenant_id.clone(),@@ -1136,7 +1128,7 @@ pub async fn construct_router_data_for_cancel<'a>(hyperswitch_domain_models::router_flow_types::Void,>,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &'a Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,_merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -1185,7 +1177,7 @@ pub async fn construct_router_data_for_cancel<'a>(// Construct RouterDataV2 for cancel operationlet router_data_v2 = construct_cancel_router_data_v2(state,- platform.get_processor().get_account(),+ processor.get_account(),merchant_connector_account,&payment_data,request,@@ -1213,7 +1205,7 @@ pub async fn construct_payment_router_data_for_sdk_session<'a>(state: &'a SessionState,payment_data: hyperswitch_domain_models::payments::PaymentIntentData<api::Session>,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &'a Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,_merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -1338,7 +1330,7 @@ pub async fn construct_payment_router_data_for_sdk_session<'a>(// TODO: evaluate the fields in router data, if they are required or notlet router_data = types::RouterData {flow: PhantomData,- merchant_id: platform.get_processor().get_account().get_id().clone(),+ merchant_id: processor.get_account().get_id().clone(),// TODO: evaluate why we need customer id at the connector level. We already have connector customer id.customer_id,connector: connector_id.to_owned(),@@ -1419,7 +1411,7 @@ pub async fn construct_payment_router_data_for_setup_mandate<'a>(state: &'a SessionState,payment_data: hyperswitch_domain_models::payments::PaymentConfirmData<api::SetupMandate>,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &'a Option<domain::Customer>,merchant_connector_account: &domain::MerchantConnectorAccountTypeDetails,_merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -1479,11 +1471,7 @@ pub async fn construct_payment_router_data_for_setup_mandate<'a>(.payment_intent.create_finish_redirection_url(router_base_url,- platform- .get_processor()- .get_account()- .publishable_key- .as_ref(),+ processor.get_account().publishable_key.as_ref(),).change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Unable to construct finish redirection url")?@@ -1563,7 +1551,7 @@ pub async fn construct_payment_router_data_for_setup_mandate<'a>(// TODO: evaluate the fields in router data, if they are required or notlet router_data = types::RouterData {flow: PhantomData,- merchant_id: platform.get_processor().get_account().get_id().clone(),+ merchant_id: processor.get_account().get_id().clone(),tenant_id: state.tenant.tenant_id.clone(),// TODO: evaluate why we need customer id at the connector level. We already have connector customer id.customer_id,@@ -1649,7 +1637,7 @@ pub async fn construct_payment_router_data<'a, F, T>(state: &'a SessionState,payment_data: PaymentData<F>,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &'a Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -1791,10 +1779,8 @@ where(state.conf.l2_l3_data_config.enabled && payment_data.is_l2_l3_enabled).then(|| {let shipping_address = unified_address.get_shipping();let billing_address = unified_address.get_payment_billing();- let merchant_tax_registration_id = platform- .get_processor()- .get_account()- .get_merchant_tax_registration_id();+ let merchant_tax_registration_id =+ processor.get_account().get_merchant_tax_registration_id();Box::new(types::L2L3Data {order_info: Some(types::OrderInfo {@@ -1858,7 +1844,7 @@ wherelet router_data = types::RouterData {flow: PhantomData,- merchant_id: platform.get_processor().get_account().get_id().clone(),+ merchant_id: processor.get_account().get_id().clone(),customer_id,tenant_id: state.tenant.tenant_id.clone(),connector: connector_id.to_owned(),@@ -1908,7 +1894,7 @@ whererecurring_mandate_payment_data: payment_data.recurring_mandate_payment_data,connector_request_reference_id: core_utils::get_connector_request_reference_id(&state.conf,- platform.get_processor(),+ processor,&payment_data.payment_intent,&payment_data.payment_attempt,connector_id,@@ -1956,7 +1942,7 @@ pub async fn construct_payment_router_data_for_update_metadata<'a>(state: &'a SessionState,payment_data: PaymentData<api::UpdateMetadata>,connector_id: &str,- platform: &domain::Platform,+ processor: &domain::Processor,customer: &'a Option<domain::Customer>,merchant_connector_account: &helpers::MerchantConnectorAccountType,merchant_recipient_data: Option<types::MerchantRecipientData>,@@ -2068,7 +2054,7 @@ pub async fn construct_payment_router_data_for_update_metadata<'a>(router_data = types::RouterData {flow: PhantomData,- merchant_id: platform.get_processor().get_account().get_id().clone(),+ merchant_id: processor.get_account().get_id().clone(),customer_id,tenant_id: state.tenant.tenant_id.clone(),connector: connector_id.to_owned(),@@ -2108,7 +2094,7 @@ pub async fn construct_payment_router_data_for_update_metadata<'a>(recurring_mandate_payment_data: payment_data.recurring_mandate_payment_data,connector_request_reference_id: core_utils::get_connector_request_reference_id(&state.conf,- platform.get_processor(),+ processor,&payment_data.payment_intent,&payment_data.payment_attempt,connector_id,diff --git a/crates/router/src/core/payments/vault_session.rs b/crates/router/src/core/payments/vault_session.rsindex fb201aecb6..c03510d0a0 100644--- a/crates/router/src/core/payments/vault_session.rs+++ b/crates/router/src/core/payments/vault_session.rs@@ -90,7 +90,7 @@ wherelet updated_customer = call_create_connector_customer_if_required(state,customer,- platform,+ platform.get_processor(),&merchant_connector_account,payment_data,)@@ -131,7 +131,7 @@ wherepub async fn call_create_connector_customer_if_required<F, Req, D>(state: &SessionState,customer: &Option<domain::Customer>,- platform: &domain::Platform,+ processor: &domain::Processor,merchant_connector_account_type: &domain::MerchantConnectorAccountTypeDetails,payment_data: &mut D,) -> RouterResult<Option<storage::CustomerUpdate>>@@ -152,7 +152,7 @@ wheremerchant_connector_account_type.get_inner_db_merchant_connector_account();let profile_id = payment_data.get_payment_intent().profile_id.clone();let default_gateway_context = gateway_context::RouterGatewayContext::direct(- platform.clone(),+ processor.clone(),merchant_connector_account_type.clone(),payment_data.get_payment_intent().merchant_id.clone(),profile_id,@@ -184,7 +184,7 @@ where.construct_router_data(state,connector.connector.id(),- platform,+ processor,customer,merchant_connector_account_type,None,diff --git a/crates/router/src/core/refunds.rs b/crates/router/src/core/refunds.rsindex 3e6aa6fed1..fd4f0b7fcc 100644--- a/crates/router/src/core/refunds.rs+++ b/crates/router/src/core/refunds.rs@@ -217,7 +217,7 @@ pub async fn trigger_refund_to_gateway(.await?;let gateway_context = gateway_context::RouterGatewayContext::direct(- platform.clone(),+ platform.get_processor().clone(),merchant_connector_account.clone(),payment_intent.merchant_id.clone(),profile_id.clone(),@@ -252,7 +252,7 @@ pub async fn trigger_refund_to_gateway(let (execution_path, updated_state) =unified_connector_service::should_call_unified_connector_service(state,- platform,+ platform.get_processor(),&router_data,None, // No previous gateway information required for refundspayments::CallConnectorAction::Trigger,@@ -271,7 +271,7 @@ pub async fn trigger_refund_to_gateway(common_enums::ExecutionPath::UnifiedConnectorService => {unified_connector_service::call_unified_connector_service_for_refund_execute(state,- platform,+ platform.get_processor(),router_data.clone(),ExecutionMode::Primary,merchant_connector_account,@@ -605,7 +605,7 @@ async fn execute_refund_execute_via_direct_with_ucs_shadow(let ucs_result =unified_connector_service::call_unified_connector_service_for_refund_execute(&ucs_state,- &ucs_platform,+ ucs_platform.get_processor(),ucs_router_data,ExecutionMode::Shadow,merchant_connector_account@@ -863,7 +863,7 @@ pub async fn sync_refund_with_gateway(.await?;let gateway_context = gateway_context::RouterGatewayContext::direct(- platform.clone(),+ platform.get_processor().clone(),merchant_connector_account.clone(),payment_intent.merchant_id.clone(),profile_id.clone(),@@ -898,7 +898,7 @@ pub async fn sync_refund_with_gateway(let (execution_path, updated_state) =unified_connector_service::should_call_unified_connector_service(state,- platform,+ platform.get_processor(),&router_data,None, // No previous gateway information required for refundspayments::CallConnectorAction::Trigger,@@ -917,7 +917,7 @@ pub async fn sync_refund_with_gateway(common_enums::ExecutionPath::UnifiedConnectorService => {unified_connector_service::call_unified_connector_service_for_refund_sync(state,- platform,+ platform.get_processor(),router_data.clone(),ExecutionMode::Primary,merchant_connector_account,@@ -1145,7 +1145,7 @@ async fn execute_refund_sync_via_direct_with_ucs_shadow(let ucs_result =unified_connector_service::call_unified_connector_service_for_refund_sync(&state,- &platform,+ platform.get_processor(),router_data,ExecutionMode::Shadow,merchant_connector_accountdiff --git a/crates/router/src/core/refunds_v2.rs b/crates/router/src/core/refunds_v2.rsindex 6360a7e6cd..1302eb1fe3 100644--- a/crates/router/src/core/refunds_v2.rs+++ b/crates/router/src/core/refunds_v2.rs@@ -165,7 +165,7 @@ pub async fn trigger_refund_to_gateway(.await?;let profile_id = payment_intent.profile_id.clone();let default_gateway_context = gateway_context::RouterGatewayContext::direct(- platform.clone(),+ platform.get_processor().clone(),merchant_connector_account,payment_intent.merchant_id.clone(),profile_id,@@ -287,7 +287,7 @@ pub async fn internal_trigger_refund_to_gateway(let profile_id = payment_intent.profile_id.clone();let default_gateway_context = gateway_context::RouterGatewayContext::direct(- platform.clone(),+ platform.get_processor().clone(),merchant_connector_account,payment_intent.merchant_id.clone(),profile_id,@@ -859,7 +859,7 @@ pub async fn sync_refund_with_gateway(.await?;let profile_id = payment_intent.profile_id.clone();let default_gateway_context = gateway_context::RouterGatewayContext::direct(- platform.clone(),+ platform.get_processor().clone(),merchant_connector_account,payment_intent.merchant_id.clone(),profile_id,@@ -955,7 +955,7 @@ pub async fn internal_sync_refund_with_gateway(.await?;let profile_id = payment_intent.profile_id.clone();let default_gateway_context = gateway_context::RouterGatewayContext::direct(- platform.clone(),+ platform.get_processor().clone(),merchant_connector_account,payment_intent.merchant_id.clone(),profile_id,diff --git a/crates/router/src/core/unified_connector_service.rs b/crates/router/src/core/unified_connector_service.rsindex b1c6eda0b3..84190c5ab6 100644--- a/crates/router/src/core/unified_connector_service.rs+++ b/crates/router/src/core/unified_connector_service.rs@@ -31,7 +31,7 @@ use hyperswitch_domain_models::merchant_connector_account::{ExternalVaultConnectorMetadata, MerchantConnectorAccountTypeDetails,};use hyperswitch_domain_models::{- platform::Platform,+ platform::Processor,router_data::{AccessToken, ConnectorAuthType, ErrorResponse, RouterData},router_flow_types::refunds,router_request_types::RefundsData,@@ -73,7 +73,7 @@ pub mod transformers;pub async fn get_access_token_from_ucs_response(session_state: &SessionState,- platform: &Platform,+ processor: &Processor,connector_name: &str,merchant_connector_id: Option<&id_type::MerchantConnectorAccountId>,creds_identifier: Option<String>,@@ -83,7 +83,7 @@ pub async fn get_access_token_from_ucs_response(.and_then(|state| state.access_token.as_ref()).map(AccessToken::foreign_from)?;- let merchant_id = platform.get_processor().get_account().get_id();+ let merchant_id = processor.get_account().get_id();let merchant_connector_id_or_connector_name = merchant_connector_id.map(|mca_id| mca_id.get_string_repr().to_string())@@ -106,13 +106,13 @@ pub async fn get_access_token_from_ucs_response(pub async fn set_access_token_for_ucs(state: &SessionState,- platform: &Platform,+ processor: &Processor,connector_name: &str,access_token: AccessToken,merchant_connector_id: Option<&id_type::MerchantConnectorAccountId>,creds_identifier: Option<String>,) -> Result<(), errors::StorageError> {- let merchant_id = platform.get_processor().get_account().get_id();+ let merchant_id = processor.get_account().get_id();let merchant_connector_id_or_connector_name = merchant_connector_id.map(|mca_id| mca_id.get_string_repr().to_string())@@ -230,7 +230,7 @@ async fn determine_connector_integration_type(pub async fn should_call_unified_connector_service<F: Clone, T, R>(state: &SessionState,- platform: &Platform,+ processor: &Processor,router_data: &RouterData<F, T, R>,previous_gateway: Option<GatewaySystem>,call_connector_action: CallConnectorAction,@@ -240,11 +240,7 @@ whereR: Send + Sync + Clone,{// Extract context information- let merchant_id = platform- .get_processor()- .get_account()- .get_id()- .get_string_repr();+ let merchant_id = processor.get_account().get_id().get_string_repr();let connector_name = &router_data.connector;let connector_enum = Connector::from_str(connector_name)@@ -553,15 +549,11 @@ wherepub async fn should_call_unified_connector_service_for_webhooks(state: &SessionState,- platform: &Platform,+ processor: &Processor,connector_name: &str,) -> RouterResult<ExecutionPath> {// Extract context information- let merchant_id = platform- .get_processor()- .get_account()- .get_id()- .get_string_repr();+ let merchant_id = processor.get_account().get_id().get_string_repr();let connector_enum = Connector::from_str(connector_name).change_context(errors::ApiErrorResponse::IncorrectConnectorNameGiven)@@ -1244,7 +1236,7 @@ fn get_ucs_client(pub fn build_unified_connector_service_auth_metadata(#[cfg(feature = "v1")] merchant_connector_account: MerchantConnectorAccountType,#[cfg(feature = "v2")] merchant_connector_account: MerchantConnectorAccountTypeDetails,- platform: &Platform,+ processor: &Processor,connector_name: String,) -> CustomResult<ConnectorAuthMetadata, UnifiedConnectorServiceError> {#[cfg(feature = "v1")]@@ -1260,11 +1252,7 @@ pub fn build_unified_connector_service_auth_metadata(.change_context(UnifiedConnectorServiceError::FailedToObtainAuthType).attach_printable("Failed to obtain ConnectorAuthType")?;- let merchant_id = platform- .get_processor()- .get_account()- .get_id()- .get_string_repr();+ let merchant_id = processor.get_account().get_id().get_string_repr();match &auth_type {ConnectorAuthType::SignatureKey {@@ -1686,7 +1674,7 @@ pub fn build_webhook_secrets_from_merchant_connector_account(/// This provides a clean interface similar to payment flow UCS callspub async fn call_unified_connector_service_for_webhook(state: &SessionState,- platform: &Platform,+ processor: &Processor,connector_name: &str,body: &actix_web::web::Bytes,request_details: &hyperswitch_interfaces::webhooks::IncomingWebhookRequestDetails<'_>,@@ -1733,11 +1721,7 @@ pub async fn call_unified_connector_service_for_webhook(body,request_details,webhook_secrets,- platform- .get_processor()- .get_account()- .get_id()- .get_string_repr(),+ processor.get_account().get_id().get_string_repr(),connector_name,)?;@@ -1753,7 +1737,7 @@ pub async fn call_unified_connector_service_for_webhook(build_unified_connector_service_auth_metadata(mca_type,- platform,+ processor,connector_name.to_string(),)})@@ -1773,7 +1757,7 @@ pub async fn call_unified_connector_service_for_webhook(let grpc_headers = state.get_grpc_headers_ucs(ExecutionMode::Primary).lineage_ids(LineageIds::new(- platform.get_processor().get_account().get_id().clone(),+ processor.get_account().get_id().clone(),profile_id,)).external_vault_proxy_metadata(None)@@ -2190,7 +2174,7 @@ pub async fn send_comparison_data(#[instrument(skip_all)]pub async fn call_unified_connector_service_for_refund_execute(state: &SessionState,- platform: &Platform,+ processor: &Processor,router_data: RouterData<refunds::Execute, RefundsData, RefundsResponseData>,execution_mode: ExecutionMode,#[cfg(feature = "v1")] merchant_connector_account: MerchantConnectorAccountType,@@ -2202,7 +2186,7 @@ pub async fn call_unified_connector_service_for_refund_execute(// Build auth metadata using standard UCS functionlet connector_auth_metadata = build_unified_connector_service_auth_metadata(merchant_connector_account,- platform,+ processor,router_data.connector.clone(),).change_context(errors::ApiErrorResponse::InternalServerError)@@ -2216,7 +2200,7 @@ pub async fn call_unified_connector_service_for_refund_execute(// Build gRPC headers// Use merchant_id as profile_id fallback since RouterData doesn't have profile_id field- let merchant_id = platform.get_processor().get_account().get_id().clone();+ let merchant_id = processor.get_account().get_id().clone();let profile_id = id_type::ProfileId::from_str(merchant_id.get_string_repr()).change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Failed to convert merchant_id to profile_id for UCS refund")?;@@ -2264,7 +2248,7 @@ pub async fn call_unified_connector_service_for_refund_execute(#[instrument(skip_all)]pub async fn call_unified_connector_service_for_refund_sync(state: &SessionState,- platform: &Platform,+ processor: &Processor,router_data: RouterData<refunds::RSync, RefundsData, RefundsResponseData>,execution_mode: ExecutionMode,#[cfg(feature = "v1")] merchant_connector_account: MerchantConnectorAccountType,@@ -2276,7 +2260,7 @@ pub async fn call_unified_connector_service_for_refund_sync(// Build auth metadata using standard UCS functionlet connector_auth_metadata = build_unified_connector_service_auth_metadata(merchant_connector_account,- platform,+ processor,router_data.connector.clone(),).change_context(errors::ApiErrorResponse::InternalServerError)@@ -2290,7 +2274,7 @@ pub async fn call_unified_connector_service_for_refund_sync(// Build gRPC headers// Use merchant_id as profile_id fallback since RouterData doesn't have profile_id field- let merchant_id = platform.get_processor().get_account().get_id().clone();+ let merchant_id = processor.get_account().get_id().clone();let profile_id = id_type::ProfileId::from_str(merchant_id.get_string_repr()).change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Failed to convert merchant_id to profile_id for UCS refund")?;diff --git a/crates/router/src/core/webhooks/incoming.rs b/crates/router/src/core/webhooks/incoming.rsindex 27bbb17055..85018d7652 100644--- a/crates/router/src/core/webhooks/incoming.rs+++ b/crates/router/src/core/webhooks/incoming.rs@@ -272,7 +272,7 @@ async fn incoming_webhooks_core<W: types::OutgoingWebhookType>(let execution_path =unified_connector_service::should_call_unified_connector_service_for_webhooks(&state,- &platform,+ platform.get_processor(),&mca_data.connector_name,).await?;@@ -529,7 +529,7 @@ async fn process_ucs_webhook_transform<'a>(let (event_type, source_verified, transform_data) =unified_connector_service::call_unified_connector_service_for_webhook(state,- platform,+ platform.get_processor(),connector_name,body,request_details,@@ -594,7 +594,7 @@ async fn process_shadow_ucs_webhook_transform<'a>(// Execute UCS pathlet ucs_result = unified_connector_service::call_unified_connector_service_for_webhook(state,- platform,+ platform.get_processor(),connector_name,body,request_details,