Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 24 additions & 22 deletions src/decider/gatewaydecider/flow_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,28 +474,30 @@ pub async fn run_decider_flow(
Some(decideGatewayOutput) => {
let cpu_time = cpu_start.elapsed().as_millis() as u64;
Ok(T::DecidedGateway {
decided_gateway: decideGatewayOutput,
gateway_priority_map: gatewayPriorityMap,
filter_wise_gateways: None,
priority_logic_tag: updatedPriorityLogicOutput
.priority_logic_tag
.clone(),
routing_approach: finalDeciderApproach.clone(),
gateway_before_evaluation: topGatewayBeforeSRDowntimeEvaluation.clone(),
priority_logic_output: Some(updatedPriorityLogicOutput),
reset_approach: decider_flow.writer.reset_approach.clone(),
routing_dimension: decider_flow.writer.routing_dimension.clone(),
routing_dimension_level: decider_flow
.writer
.routing_dimension_level
.clone(),
is_scheduled_outage: decider_flow.writer.isScheduledOutage,
is_dynamic_mga_enabled: decider_flow.writer.is_dynamic_mga_enabled,
gateway_mga_id_map: None,
debit_routing_output: None,
is_rust_based_decider: true,
latency: Some(cpu_time),
})},
decided_gateway: decideGatewayOutput,
gateway_priority_map: gatewayPriorityMap,
filter_wise_gateways: None,
priority_logic_tag: updatedPriorityLogicOutput
.priority_logic_tag
.clone(),
routing_approach: finalDeciderApproach.clone(),
gateway_before_evaluation: topGatewayBeforeSRDowntimeEvaluation
.clone(),
priority_logic_output: Some(updatedPriorityLogicOutput),
reset_approach: decider_flow.writer.reset_approach.clone(),
routing_dimension: decider_flow.writer.routing_dimension.clone(),
routing_dimension_level: decider_flow
.writer
.routing_dimension_level
.clone(),
is_scheduled_outage: decider_flow.writer.isScheduledOutage,
is_dynamic_mga_enabled: decider_flow.writer.is_dynamic_mga_enabled,
gateway_mga_id_map: None,
debit_routing_output: None,
is_rust_based_decider: true,
latency: Some(cpu_time),
})
}
None => Err((
decider_flow.writer.debugFilterList.clone(),
decider_flow.writer.debugScoringList.clone(),
Expand Down
14 changes: 7 additions & 7 deletions src/decider/gatewaydecider/gw_filter_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ pub async fn filterFunctionalGateways(this: &mut DeciderFlow<'_>) -> GatewayList
let mPmEntryDB = ETP::get_by_name(brand).await;
if let Some(cardPaymentMethod) = mPmEntryDB {
let uniqueGwLs: Vec<Gateway> = st.into_iter().collect();
let allGPMfEntries = GPMF::find_all_gpmf_by_gateway_payment_flow_payment_method(uniqueGwLs.clone(), cardPaymentMethod.id, PaymentFlow::CVVLESS,).await;
let allGPMfEntries = GPMF::find_all_gpmf_by_gateway_payment_flow_payment_method(uniqueGwLs.clone(), cardPaymentMethod.id, PaymentFlow::CVVLESS).await;
let gmpfGws: Vec<Gateway> = allGPMfEntries.iter()
.map(|gpmf| gpmf.gateway.clone())
.collect();
Expand Down Expand Up @@ -2323,7 +2323,7 @@ fn get_zero_auth_supported_gateways(txn_type: &str, txn_detail_type_restricted_g
.map_or_else(Vec::new, |mapping| mapping.1.clone())
}

pub async fn filterGatewaysForTxnDetailType(this: &mut DeciderFlow<'_>,) -> Vec<ETG::Gateway> {
pub async fn filterGatewaysForTxnDetailType(this: &mut DeciderFlow<'_>) -> Vec<ETG::Gateway> {
let st = getGws(this);
let m_txn_type = this.get().dpTxnDetail.txnType.clone();
let txn_type: &str = m_txn_type.as_str();
Expand All @@ -2341,7 +2341,7 @@ pub async fn filterGatewaysForTxnDetailType(this: &mut DeciderFlow<'_>,) -> Vec<
returnGwListWithLog(this, DeciderFilterName::FilterFunctionalGatewaysForTxnDetailType, true)
}

pub async fn filterGatewaysForReward(this: &mut DeciderFlow<'_>,) -> Vec<ETG::Gateway> {
pub async fn filterGatewaysForReward(this: &mut DeciderFlow<'_>) -> Vec<ETG::Gateway> {
let st = getGws(this) ;
let payment_method_type = this.get().dpTxnCardInfo.paymentMethodType.clone();
let card_type = this.get().dpTxnCardInfo.card_type.clone();
Expand All @@ -2368,7 +2368,7 @@ pub async fn filterGatewaysForReward(this: &mut DeciderFlow<'_>,) -> Vec<ETG::Ga



pub async fn filterGatewaysForCash(this: &mut DeciderFlow<'_>,) -> Vec<ETG::Gateway> {
pub async fn filterGatewaysForCash(this: &mut DeciderFlow<'_>) -> Vec<ETG::Gateway> {
let st = getGws(this);
let payment_method_type = this.get().dpTxnCardInfo.paymentMethodType.clone();
if payment_method_type != ETP::PaymentMethodType::Cash {
Expand All @@ -2382,7 +2382,7 @@ pub async fn filterGatewaysForCash(this: &mut DeciderFlow<'_>,) -> Vec<ETG::Gate
returnGwListWithLog(this, DeciderFilterName::FilterFunctionalGatewaysForCash, true)
}

pub async fn filterFunctionalGatewaysForSplitSettlement(this: &mut DeciderFlow<'_>,) -> Vec<ETG::Gateway> {
pub async fn filterFunctionalGatewaysForSplitSettlement(this: &mut DeciderFlow<'_>) -> Vec<ETG::Gateway> {
let oref = this.get().dpOrder.clone();
let txn_id = this.get().dpTxnDetail.clone();
let e_split_settlement_details = Utils::get_split_settlement_details(this).await;
Expand Down Expand Up @@ -2491,11 +2491,11 @@ pub async fn filterFunctionalGatewaysForSplitSettlement(this: &mut DeciderFlow<'
returnGwListWithLog(this, DeciderFilterName::FilterFunctionalGatewaysForSplitSettlement, true)
}

pub fn log_final_functional_gateways(this: &mut DeciderFlow<'_>,) -> Vec<ETG::Gateway> {
pub fn log_final_functional_gateways(this: &mut DeciderFlow<'_>) -> Vec<ETG::Gateway> {
returnGwListWithLog(this, DeciderFilterName::FinalFunctionalGateways, false)
}

pub async fn filterGatewaysForPaymentMethod (this: &mut DeciderFlow<'_>,) -> Vec<ETG::Gateway> {
pub async fn filterGatewaysForPaymentMethod (this: &mut DeciderFlow<'_>) -> Vec<ETG::Gateway> {
let st = getGws(this) ;
let txn = this.get().dpTxnDetail.clone();
let merchant_acc = this.get().dpMerchantAccount.clone();
Expand Down
8 changes: 4 additions & 4 deletions src/feedback/gateway_scoring_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,14 @@ pub fn update_gateway_score_lock(
txn_uuid: String,
gateway: String,
) -> String {
match (gateway_scoring_type) {
(GatewayScoringType::Penalise) => {
match gateway_scoring_type {
GatewayScoringType::Penalise => {
format!("gateway_scores_lock_PENALISE_{}_{}", txn_uuid, gateway)
}
(GatewayScoringType::PenaliseSrv3) => {
GatewayScoringType::PenaliseSrv3 => {
format!("gateway_scores_lock_PENALISE_SRV3_{}_{}", txn_uuid, gateway)
}
(GatewayScoringType::Reward) => {
GatewayScoringType::Reward => {
format!("gateway_scores_lock_REWARD_{}_{}", txn_uuid, gateway)
}
_ => String::new(),
Expand Down
2 changes: 1 addition & 1 deletion src/feedback/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ pub fn getTxnTypeFromInternalMetadata(internal_metadata: Option<Secret<String>>)
tag = "APP_DEBUG",
"FETCH_TXN_TYPE_FROM_IM_FLOW"
);
(MandateTxnType::Default)
MandateTxnType::Default
}
Some(internal_metadata) => {
match serde_json::from_str::<MandateTxnInfo>(internal_metadata.peek()) {
Expand Down
Loading