Skip to content

Commit

Permalink
refactor(customer): return redacted customer instead of error (#7122)
Browse files Browse the repository at this point in the history
  • Loading branch information
AmeyWale authored Feb 6, 2025
1 parent 8ae5267 commit 97e9270
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/router/src/core/customers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,15 +463,17 @@ pub async fn retrieve_customer(
let key_manager_state = &(&state).into();

let response = db
.find_customer_by_customer_id_merchant_id(
.find_customer_optional_with_redacted_customer_details_by_customer_id_merchant_id(
key_manager_state,
&customer_id,
merchant_account.get_id(),
&key_store,
merchant_account.storage_scheme,
)
.await
.switch()?;
.switch()?
.ok_or(errors::CustomersErrorResponse::CustomerNotFound)?;

let address = match &response.address_id {
Some(address_id) => Some(api_models::payments::AddressDetails::from(
db.find_address_by_address_id(key_manager_state, address_id, &key_store)
Expand Down

0 comments on commit 97e9270

Please sign in to comment.