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
refactor(cards,router): Remove duplicated card number interface (#4404)
YongJoon Kim27ae437a8849
diff --git a/crates/api_models/src/payment_methods.rs b/crates/api_models/src/payment_methods.rsindex e045cf2c42..dd7791ee2d 100644--- a/crates/api_models/src/payment_methods.rs+++ b/crates/api_models/src/payment_methods.rs@@ -361,7 +361,7 @@ impl From<CardDetailFromLocker> for payments::AdditionalCardInfo {card_isin: item.card_isin,card_extended_bin: item.card_number- .map(|card_number| card_number.get_card_extended_bin()),+ .map(|card_number| card_number.get_extended_card_bin()),card_exp_month: item.expiry_month,card_exp_year: item.expiry_year,card_holder_name: item.card_holder_name,diff --git a/crates/cards/src/validate.rs b/crates/cards/src/validate.rsindex 08ad127047..5a71aaa786 100644--- a/crates/cards/src/validate.rs+++ b/crates/cards/src/validate.rs@@ -24,7 +24,6 @@ impl CardNumber {pub fn get_card_isin(self) -> String {self.0.peek().chars().take(6).collect::<String>()}-pub fn get_extended_card_bin(self) -> String {self.0.peek().chars().take(8).collect::<String>()}@@ -42,9 +41,6 @@ impl CardNumber {.rev().collect::<String>()}- pub fn get_card_extended_bin(self) -> String {- self.0.peek().chars().take(8).collect::<String>()- }}impl FromStr for CardNumber {diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rsindex 1789c3c3fa..38acf574a7 100644--- a/crates/router/src/core/payments/helpers.rs+++ b/crates/router/src/core/payments/helpers.rs@@ -3719,7 +3719,7 @@ pub async fn get_additional_payment_data(let card_extended_bin = match enable_extended_bin {Some(config) if config.config == "true" => {- Some(card_data.card_number.clone().get_card_extended_bin())+ Some(card_data.card_number.clone().get_extended_card_bin())}_ => None,};