Skip to content

Commit

Permalink
chore: refactored the route to payment_methods prefixed routes
Browse files Browse the repository at this point in the history
  • Loading branch information
prajjwalkumar17 committed Jan 2, 2024
2 parents 1c7a629 + d177c09 commit 488255d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
1 change: 0 additions & 1 deletion crates/api_models/src/pm_blacklist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,3 @@ impl ApiEventMetric for BlacklistPmResponse {}
impl ApiEventMetric for UnblockPmResponse {}
impl ApiEventMetric for UnblockPmRequest {}
impl ApiEventMetric for ListBlockedPmResponse {}

1 change: 0 additions & 1 deletion crates/diesel_models/src/query/pm_fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@ impl PmFingerprint {
.await
}
}

16 changes: 7 additions & 9 deletions crates/router/src/core/pm_blacklist/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ pub async fn delete_from_blocklist_lookup_db(
for (fingerprint_result, pm_hash) in fingerprint_lookup.into_iter().zip(pm_hashes.iter()) {
match fingerprint_result {
Ok(fingerprint) => {
let query_future =
state.store.delete_blocklist_lookup_entry_by_merchant_id_kms_decrypted_hash(
let query_future = state
.store
.delete_blocklist_lookup_entry_by_merchant_id_kms_decrypted_hash(
merchant_id.clone(),
fingerprint.kms_hash,
);
Expand All @@ -60,7 +61,8 @@ pub async fn delete_from_blocklist_lookup_db(
}
}

let unblocked_from_lookup = futures::future::join_all(lookup_entries.into_iter().map(|(future, _)| future)).await;
let unblocked_from_lookup =
futures::future::join_all(lookup_entries.into_iter().map(|(future, _)| future)).await;

let unblocked_from_blocklist = unblocked_from_blocklist
.into_iter()
Expand All @@ -78,9 +80,8 @@ pub async fn delete_from_blocklist_lookup_db(
result.unwrap_or_else(|e| {
logger::error!("Unblocking pm failed {e:?}");
false // Assume it's not unblocked in case of an error
})
})
}
)
.collect::<Vec<_>>();

let mut unblocked_pm = Vec::new();
Expand All @@ -101,9 +102,7 @@ pub async fn delete_from_blocklist_lookup_db(
logger::error!("Unblocking pm failed for: {:?}", not_unblocked_pm);
}

Ok(pm_blacklist::UnblockPmResponse {
unblocked_pm,
})
Ok(pm_blacklist::UnblockPmResponse { unblocked_pm })
}

pub async fn list_blocked_pm_from_db(
Expand Down Expand Up @@ -421,4 +420,3 @@ fn remove_duplicates<T: Eq + std::hash::Hash + Clone>(vec: &Vec<T>) -> Vec<T> {
})
.collect()
}

0 comments on commit 488255d

Please sign in to comment.