refactor: Add routing_approach other variant to handle unknown data (#8754)

This commit is contained in:
Sarthak Soni
2025-07-28 12:59:13 +05:30
committed by GitHub
parent 7667ec1ca9
commit 7682cd445e
28 changed files with 59 additions and 29 deletions

View File

@ -8020,6 +8020,10 @@ where
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed execution of straight through routing")?;
payment_data.set_routing_approach_in_attempt(Some(
common_enums::RoutingApproach::StraightThroughRouting,
));
if check_eligibility {
let transaction_data = core_routing::PaymentsDslInput::new(
payment_data.get_setup_mandate(),

View File

@ -882,7 +882,7 @@ impl<F: Clone + Sync> UpdateTracker<F, PaymentData<F>, api::PaymentsRequest> for
.as_ref()
.map(|surcharge_details| surcharge_details.tax_on_surcharge_amount);
let routing_approach = payment_data.payment_attempt.routing_approach;
let routing_approach = payment_data.payment_attempt.routing_approach.clone();
payment_data.payment_attempt = state
.store

View File

@ -522,7 +522,10 @@ pub async fn perform_static_routing_v1(
};
let (routable_connectors, routing_approach) = match cached_algorithm.as_ref() {
CachedAlgorithm::Single(conn) => (vec![(**conn).clone()], None),
CachedAlgorithm::Single(conn) => (
vec![(**conn).clone()],
Some(common_enums::RoutingApproach::StraightThroughRouting),
),
CachedAlgorithm::Priority(plist) => (plist.clone(), None),
CachedAlgorithm::VolumeSplit(splits) => (
perform_volume_split(splits.to_vec())
@ -1390,7 +1393,10 @@ async fn perform_session_routing_for_pm_type(
.await?;
match cached_algorithm.as_ref() {
CachedAlgorithm::Single(conn) => (vec![(**conn).clone()], None),
CachedAlgorithm::Single(conn) => (
vec![(**conn).clone()],
Some(common_enums::RoutingApproach::StraightThroughRouting),
),
CachedAlgorithm::Priority(plist) => (plist.clone(), None),
CachedAlgorithm::VolumeSplit(splits) => (
perform_volume_split(splits.to_vec())

View File

@ -132,7 +132,7 @@ impl<'a> KafkaPaymentAttempt<'a> {
card_discovery: attempt
.card_discovery
.map(|discovery| discovery.to_string()),
routing_approach: attempt.routing_approach,
routing_approach: attempt.routing_approach.clone(),
debit_routing_savings: attempt.debit_routing_savings,
}
}

View File

@ -133,7 +133,7 @@ impl<'a> KafkaPaymentAttemptEvent<'a> {
card_discovery: attempt
.card_discovery
.map(|discovery| discovery.to_string()),
routing_approach: attempt.routing_approach,
routing_approach: attempt.routing_approach.clone(),
debit_routing_savings: attempt.debit_routing_savings,
}
}