Skip to content

Commit

Permalink
chore: run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperswitch-bot[bot] committed Dec 23, 2024
1 parent 13a7150 commit d9e1e33
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
12 changes: 9 additions & 3 deletions crates/router/src/core/payment_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 2 additions & 6 deletions crates/router/src/core/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4478,12 +4478,8 @@ impl VaultData {
) -> Option<hyperswitch_domain_models::payment_method_data::NetworkTokenData> {
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()),
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions crates/router/src/core/payments/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2449,7 +2449,7 @@ pub async fn make_pm_data<'a, F: Clone, R, D>(
BoxedOperation<'a, F, R, D>,
Option<domain::PaymentMethodData>,
Option<String>,
)>{
)> {
use super::OperationSessionSetters;
use crate::core::payments::OperationSessionGetters;

Expand Down Expand Up @@ -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,
};
Expand Down

0 comments on commit d9e1e33

Please sign in to comment.