Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
fix(payment_methods): populate card fields while saving card again during metadata change condition (#5019)
Chethan Rao010e6fe3eef9
diff --git a/crates/router/src/core/payment_methods/cards.rs b/crates/router/src/core/payment_methods/cards.rsindex 66940fa950..ba2de78a6a 100644--- a/crates/router/src/core/payment_methods/cards.rs+++ b/crates/router/src/core/payment_methods/cards.rs@@ -653,9 +653,10 @@ pub async fn add_payment_method(};let updated_card = Some(api::CardDetailFromLocker {- scheme: None,+ scheme: existing_pm.scheme.clone(),last4_digits: Some(card.card_number.get_last4()),- issuer_country: None,+ issuer_country: card.card_issuing_country,+ card_isin: Some(card.card_number.get_card_isin()),card_number: Some(card.card_number),expiry_month: Some(card.card_exp_month),expiry_year: Some(card.card_exp_year),@@ -663,10 +664,9 @@ pub async fn add_payment_method(card_fingerprint: None,card_holder_name: card.card_holder_name,nick_name: card.nick_name,- card_network: None,- card_isin: None,- card_issuer: None,- card_type: None,+ card_network: card.card_network,+ card_issuer: card.card_issuer,+ card_type: card.card_type,saved_to_locker: true,});diff --git a/crates/router/src/core/payment_methods/transformers.rs b/crates/router/src/core/payment_methods/transformers.rsindex 21aa51b46a..ca0cbb2a0f 100644--- a/crates/router/src/core/payment_methods/transformers.rs+++ b/crates/router/src/core/payment_methods/transformers.rs@@ -346,7 +346,7 @@ pub fn mk_add_card_response_hs(let card = api::CardDetailFromLocker {scheme: None,last4_digits: Some(last4_digits),- issuer_country: None,+ issuer_country: card.card_issuing_country,card_number: Some(card.card_number.clone()),expiry_month: Some(card.card_exp_month.clone()),expiry_year: Some(card.card_exp_year.clone()),diff --git a/crates/router/src/core/payments/tokenization.rs b/crates/router/src/core/payments/tokenization.rsindex 2d5d216a85..715963cdc9 100644--- a/crates/router/src/core/payments/tokenization.rs+++ b/crates/router/src/core/payments/tokenization.rs@@ -469,9 +469,10 @@ where};let updated_card = Some(CardDetailFromLocker {- scheme: None,+ scheme: existing_pm.scheme.clone(),last4_digits: Some(card.card_number.get_last4()),- issuer_country: None,+ issuer_country: card.card_issuing_country,+ card_isin: Some(card.card_number.get_card_isin()),card_number: Some(card.card_number),expiry_month: Some(card.card_exp_month),expiry_year: Some(card.card_exp_year),@@ -479,10 +480,9 @@ wherecard_fingerprint: None,card_holder_name: card.card_holder_name,nick_name: card.nick_name,- card_network: None,- card_isin: None,- card_issuer: None,- card_type: None,+ card_network: card.card_network,+ card_issuer: card.card_issuer,+ card_type: card.card_type,saved_to_locker: true,});