Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hrithikesh026 committed Dec 4, 2023
1 parent 1133a53 commit cc72c91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
21 changes: 3 additions & 18 deletions crates/router/src/core/payments/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1486,19 +1486,6 @@ pub async fn retrieve_card_with_permanent_token(
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("failed to fetch card information from the permanent locker")?;

let payment_method = state
.store
.find_payment_method(token)
.await
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed to fetch payment method")?;
let card_network = payment_method
.scheme
.map(|scheme| scheme.parse_enum("CardNetwork"))
.transpose()
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed deserilaize card network")?;

let name_on_card = if let Some(name_on_card) = card.name_on_card.clone() {
if card.name_on_card.unwrap_or_default().expose().is_empty() {
card_token_data
Expand All @@ -1519,12 +1506,10 @@ pub async fn retrieve_card_with_permanent_token(
card_exp_month: card.card_exp_month,
card_exp_year: card.card_exp_year,
card_cvc: card_cvc.unwrap_or_default(),
card_issuer: card.card_brand.or(payment_method.issuer_name),
card_issuer: card.card_brand,
nick_name: card.nick_name.map(masking::Secret::new),
card_network,
card_type: payment_method
.payment_method_type
.map(|payment_method_type| payment_method_type.to_string()),
card_network: None,
card_type: None,
card_issuing_country: None,
bank_code: None,
};
Expand Down
2 changes: 0 additions & 2 deletions crates/router/src/core/payments/operations/payment_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
payment_method_data.apply_additional_payment_data(additional_payment_data)
});

logger::debug!(payment_method_data_after_card_bin_call=?payment_method_data_after_card_bin_call);

let payment_data = PaymentData {
flow: PhantomData,
payment_intent,
Expand Down

0 comments on commit cc72c91

Please sign in to comment.