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
chore(payment-methods): card expiry addition to v2 (#10811)
Shivansh Mathurc2f0e5932a17
diff --git a/crates/router/src/core/payment_methods.rs b/crates/router/src/core/payment_methods.rsindex 25a356bbda..6e932e59cb 100644--- a/crates/router/src/core/payment_methods.rs+++ b/crates/router/src/core/payment_methods.rs@@ -714,6 +714,11 @@ pub(crate) fn get_payment_method_create_request() -> RouterResult<payment_methods::PaymentMethodCreate> {match payment_method_data {api_models::payments::PaymentMethodData::Card(card) => {+ payments_core::helpers::validate_card_expiry(+ &card.card_exp_month,+ &card.card_exp_year,+ )?;+let card_detail = payment_methods::CardDetail {card_number: card.card_number.clone(),card_exp_month: card.card_exp_month.clone(),@@ -1098,6 +1103,18 @@ pub async fn create_payment_method_card_core(Encryptable<hyperswitch_domain_models::address::Address>,>,) -> RouterResult<(api::PaymentMethodResponse, domain::PaymentMethod)> {+ match &req.payment_method_data {+ api::PaymentMethodCreateData::Card(card_data) => {+ payments_core::helpers::validate_card_expiry(+ &card_data.card_exp_month,+ &card_data.card_exp_year,+ )?;+ }+ _ => {+ logger::debug!("Payment method data is not CardDetail");+ }+ }+let db = &*state.store;let payment_method = create_payment_method_for_intent(