mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 19:42:27 +08:00
refactor: Add routing_approach other variant to handle unknown data (#8754)
This commit is contained in:
@ -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(),
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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())
|
||||
|
||||
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user