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 Jan 20, 2025
1 parent cf50f1c commit 9952b8d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 36 deletions.
5 changes: 4 additions & 1 deletion crates/router/src/core/payment_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,10 @@ pub async fn create_payment_method_for_intent(
let ephemeral_key = payment_helpers::create_ephemeral_key(
state,
merchant_id,
vec![diesel_models::ResourceId::Customer(customer_id.clone()), diesel_models::ResourceId::PaymentMethod(payment_method_id.clone())],
vec![
diesel_models::ResourceId::Customer(customer_id.clone()),
diesel_models::ResourceId::PaymentMethod(payment_method_id.clone()),
],
)
.await
.change_context(errors::ApiErrorResponse::InternalServerError)
Expand Down
65 changes: 31 additions & 34 deletions crates/router/src/services/authentication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1845,40 +1845,37 @@ where
{
return Err(errors::ApiErrorResponse::Unauthorized.into());
}
let profile_id = get_id_type_by_key_from_headers(
headers::X_PROFILE_ID.to_string(),
request_headers,
)?
.get_required_value(headers::X_PROFILE_ID)?;

let (merchant_account, key_store) = state
.store()
.find_merchant_account_by_publishable_key(
key_manager_state,
publishable_key,
)
.await
.to_not_found_response(errors::ApiErrorResponse::Unauthorized)?;
let merchant_id = merchant_account.get_id().clone();
let profile = state
.store()
.find_business_profile_by_merchant_id_profile_id(
key_manager_state,
&key_store,
&merchant_id,
&profile_id,
)
.await
.to_not_found_response(errors::ApiErrorResponse::Unauthorized)?;
Ok((
AuthenticationData {
merchant_account,
key_store,
profile,
platform_merchant_account: None,
},
AuthenticationType::PublishableKey { merchant_id },
))
let profile_id = get_id_type_by_key_from_headers(
headers::X_PROFILE_ID.to_string(),
request_headers,
)?
.get_required_value(headers::X_PROFILE_ID)?;

let (merchant_account, key_store) = state
.store()
.find_merchant_account_by_publishable_key(key_manager_state, publishable_key)
.await
.to_not_found_response(errors::ApiErrorResponse::Unauthorized)?;
let merchant_id = merchant_account.get_id().clone();
let profile = state
.store()
.find_business_profile_by_merchant_id_profile_id(
key_manager_state,
&key_store,
&merchant_id,
&profile_id,
)
.await
.to_not_found_response(errors::ApiErrorResponse::Unauthorized)?;
Ok((
AuthenticationData {
merchant_account,
key_store,
profile,
platform_merchant_account: None,
},
AuthenticationType::PublishableKey { merchant_id },
))
}
Self::DashboardAuth => Err(errors::ApiErrorResponse::Unauthorized.into()),
}
Expand Down
4 changes: 3 additions & 1 deletion crates/router/src/types/storage/ephemeral_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ impl ForeignTryFrom<EphemeralKeyType> for api_models::ephemeral_key::EphemeralKe
let result = from.resource_id.iter().find_map(|item| {
if let diesel_models::ResourceId::Customer(customer_id) = item {
Some(Self {
resource_id: api_models::ephemeral_key::ResourceId::Customer(customer_id.clone()),
resource_id: api_models::ephemeral_key::ResourceId::Customer(
customer_id.clone(),
),
created_at: from.created_at,
expires: from.expires,
secret: from.secret.clone(),
Expand Down

0 comments on commit 9952b8d

Please sign in to comment.