feat(core): Consuming locale in PaymentsAuthorizeData from SessionState (#8731)

Co-authored-by: Sayak Bhattacharya <sayak.b@Sayak-Bhattacharya-G092THXJ34.local>
This commit is contained in:
Sayak Bhattacharya
2025-07-24 20:31:45 +05:30
committed by GitHub
parent 56d8ed7245
commit be03dd2ae9
11 changed files with 25 additions and 16 deletions

View File

@ -2039,8 +2039,7 @@ pub fn decide_payment_method_retrieval_action(
pub async fn is_ucs_enabled(state: &SessionState, config_key: &str) -> bool {
let db = state.store.as_ref();
let is_enabled = db
.find_config_by_key_unwrap_or(config_key, Some("false".to_string()))
db.find_config_by_key_unwrap_or(config_key, Some("false".to_string()))
.await
.map_err(|error| {
logger::error!(
@ -2053,9 +2052,7 @@ pub async fn is_ucs_enabled(state: &SessionState, config_key: &str) -> bool {
logger::error!(?error, "Failed to parse `{config_key}` UCS enabled config");
})
})
.unwrap_or(false);
is_enabled
.unwrap_or(false)
}
pub async fn should_execute_based_on_rollout(

View File

@ -270,6 +270,7 @@ pub async fn construct_payment_router_data_for_authorize<'a>(
.browser_info
.clone()
.map(types::BrowserInformation::from);
// TODO: few fields are repeated in both routerdata and request
let request = types::PaymentsAuthorizeData {
payment_method_data: payment_data
@ -325,6 +326,7 @@ pub async fn construct_payment_router_data_for_authorize<'a>(
merchant_config_currency: None,
connector_testing_data: None,
order_id: None,
locale: None,
};
let connector_mandate_request_reference_id = payment_data
.payment_attempt
@ -3588,6 +3590,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsAuthoriz
merchant_config_currency: None,
connector_testing_data: None,
order_id: None,
locale: None,
})
}
}
@ -3819,6 +3822,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsAuthoriz
merchant_config_currency,
connector_testing_data,
order_id: None,
locale: Some(additional_data.state.locale.clone()),
})
}
}

View File

@ -1091,6 +1091,7 @@ impl ForeignFrom<&SetupMandateRouterData> for PaymentsAuthorizeData {
merchant_config_currency: None,
connector_testing_data: data.request.connector_testing_data.clone(),
order_id: None,
locale: None,
}
}
}

View File

@ -65,6 +65,7 @@ impl VerifyConnectorData {
merchant_config_currency: None,
connector_testing_data: None,
order_id: None,
locale: None,
}
}