Skip to content

Commit

Permalink
fix(payment_methods): revert the filter for getting the mcas which ar…
Browse files Browse the repository at this point in the history
…e disabled (#4756)
  • Loading branch information
Aprabhat19 authored May 24, 2024
1 parent 55ccce6 commit 9fb2a83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions crates/diesel_models/src/query/merchant_connector_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ impl MerchantConnectorAccount {
if get_disabled {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::disabled.eq(true)),
dsl::merchant_id.eq(merchant_id.to_owned()),
None,
None,
Some(dsl::created_at.asc()),
Expand Down
5 changes: 5 additions & 0 deletions crates/router/src/core/payment_methods/cards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3700,7 +3700,12 @@ pub async fn get_mca_status(
.change_context(errors::ApiErrorResponse::MerchantConnectorAccountNotFound {
id: merchant_id.to_string(),
})?;

let mut mca_ids = HashSet::new();
let mcas = mcas
.into_iter()
.filter(|mca| mca.disabled == Some(true))
.collect::<Vec<_>>();

for mca in mcas {
mca_ids.insert(mca.merchant_connector_id);
Expand Down

0 comments on commit 9fb2a83

Please sign in to comment.