Skip to content

Commit

Permalink
fix(router): return collect_billing_details_from_wallet_connector i…
Browse files Browse the repository at this point in the history
…f `always_collect_billing_details_from_wallet_connector ` is false in merchant payment method list (#5857)
  • Loading branch information
ShankarSinghC authored Sep 12, 2024
1 parent de5f31a commit 32fd4ee
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions crates/router/src/core/payment_methods/cards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3652,23 +3652,29 @@ pub async fn list_payment_methods(
api_surcharge_decision_configs::MerchantSurchargeConfigs::default()
};

let collect_shipping_details_from_wallets = business_profile
.as_ref()
.and_then(|business_profile| {
business_profile.always_collect_shipping_details_from_wallet_connector
})
.or(business_profile.as_ref().and_then(|business_profile| {
business_profile.collect_shipping_details_from_wallet_connector
}));
let collect_shipping_details_from_wallets =
business_profile.as_ref().and_then(|business_profile| {
if business_profile
.always_collect_shipping_details_from_wallet_connector
.unwrap_or(false)
{
business_profile.always_collect_shipping_details_from_wallet_connector
} else {
business_profile.collect_shipping_details_from_wallet_connector
}
});

let collect_billing_details_from_wallets = business_profile
.as_ref()
.and_then(|business_profile| {
business_profile.always_collect_billing_details_from_wallet_connector
})
.or(business_profile.as_ref().and_then(|business_profile| {
business_profile.collect_billing_details_from_wallet_connector
}));
let collect_billing_details_from_wallets =
business_profile.as_ref().and_then(|business_profile| {
if business_profile
.always_collect_billing_details_from_wallet_connector
.unwrap_or(false)
{
business_profile.always_collect_billing_details_from_wallet_connector
} else {
business_profile.collect_billing_details_from_wallet_connector
}
});

Ok(services::ApplicationResponse::Json(
api::PaymentMethodListResponse {
Expand Down

0 comments on commit 32fd4ee

Please sign in to comment.