diff --git a/crates/router/src/core/payment_methods.rs b/crates/router/src/core/payment_methods.rs index ce0d511e7f6f..7f817e25004b 100644 --- a/crates/router/src/core/payment_methods.rs +++ b/crates/router/src/core/payment_methods.rs @@ -24,7 +24,7 @@ use api_models::payment_methods; #[cfg(feature = "payouts")] pub use api_models::{enums::PayoutConnectors, payouts as payout_types}; #[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))] -use common_utils::ext_traits::{Encode, OptionExt,}; +use common_utils::ext_traits::{Encode, OptionExt}; use common_utils::{consts::DEFAULT_LOCALE, id_type}; #[cfg(all(feature = "v2", feature = "payment_methods_v2"))] use common_utils::{ @@ -592,7 +592,10 @@ pub async fn retrieve_payment_method_with_token( merchant_key_store, storage_scheme, mandate_id, - payment_method_info.get_required_value("PaymentMethod").change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("PaymentMethod not found")?, + payment_method_info + .get_required_value("PaymentMethod") + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("PaymentMethod not found")?, business_profile, payment_attempt.connector.clone(), should_retry_with_pan, @@ -629,7 +632,10 @@ pub async fn retrieve_payment_method_with_token( merchant_key_store, storage_scheme, mandate_id, - payment_method_info.get_required_value("PaymentMethod").change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("PaymentMethod not found")?, + payment_method_info + .get_required_value("PaymentMethod") + .change_context(errors::ApiErrorResponse::InternalServerError) + .attach_printable("PaymentMethod not found")?, business_profile, payment_attempt.connector.clone(), should_retry_with_pan, diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs index c871be7c1115..e2606e26e9a3 100644 --- a/crates/router/src/core/payments.rs +++ b/crates/router/src/core/payments.rs @@ -4478,12 +4478,8 @@ impl VaultData { ) -> Option { match self { Self::CardVaultData(_card_data) => None, - Self::NetworkTokenVaultData(network_token_data) => { - Some(network_token_data.clone()) - } - Self::CardAndNetworkToken(vault_data) => { - Some(vault_data.network_token_data.clone()) - } + Self::NetworkTokenVaultData(network_token_data) => Some(network_token_data.clone()), + Self::CardAndNetworkToken(vault_data) => Some(vault_data.network_token_data.clone()), } } } diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs index 4b3ba2d53c98..72599ce2eed4 100644 --- a/crates/router/src/core/payments/helpers.rs +++ b/crates/router/src/core/payments/helpers.rs @@ -2449,7 +2449,7 @@ pub async fn make_pm_data<'a, F: Clone, R, D>( BoxedOperation<'a, F, R, D>, Option, Option, -)>{ +)> { use super::OperationSessionSetters; use crate::core::payments::OperationSessionGetters; @@ -2546,27 +2546,27 @@ pub async fn make_pm_data<'a, F: Clone, R, D>( payments::VaultData::CardVaultData(card), domain::PaymentMethodData::NetworkToken(nt_data), ) => Some(payments::PaymentMethodDataAction::ExistingVaultData( - payments::VaultData::CardAndNetworkToken( - Box::new(payments::CardAndNetworkTokenData { + payments::VaultData::CardAndNetworkToken(Box::new( + payments::CardAndNetworkTokenData { card_data: card.clone(), network_token_data: nt_data.clone(), - }) - ), + }, + )), )), ( payments::VaultData::NetworkTokenVaultData(nt_data), domain::PaymentMethodData::Card(card), ) => Some(payments::PaymentMethodDataAction::ExistingVaultData( - payments::VaultData::CardAndNetworkToken( - Box::new(payments::CardAndNetworkTokenData { + payments::VaultData::CardAndNetworkToken(Box::new( + payments::CardAndNetworkTokenData { card_data: card.clone(), network_token_data: nt_data.clone(), - }) - ), + }, + )), )), _ => Some(payments::PaymentMethodDataAction::ExistingVaultData( vault_data.clone(), - )) + )), }, _ => None, };