Skip to content

Commit

Permalink
fix(payment_methods): unmask last4 digits of card when listing paymen…
Browse files Browse the repository at this point in the history
…t methods for customer (#3621)
  • Loading branch information
Chethan-rao authored Feb 12, 2024
1 parent ea54b3d commit b59b90e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions crates/router/src/core/payment_methods/cards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,7 @@ pub async fn add_payment_method(
Ok(pm) => {
let updated_card = Some(api::CardDetailFromLocker {
scheme: None,
last4_digits: Some(
card.card_number
.to_string()
.split_off(card.card_number.to_string().len() - 4),
),
last4_digits: Some(card.card_number.clone().get_last4()),
issuer_country: None,
card_number: Some(card.card_number),
expiry_month: Some(card.card_exp_month),
Expand Down

0 comments on commit b59b90e

Please sign in to comment.