Skip to content

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

fix(router): add card expiry check in the `network_transaction_id_and_card_details` based `MIT` flow (#6504)

Shankar Singh C5af532a1212e
diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs
index ebf49daa80..61572763af 100644
--- a/crates/router/src/core/payments.rs
+++ b/crates/router/src/core/payments.rs
@@ -4470,6 +4470,11 @@ where
let (mandate_reference_id, card_details_for_network_transaction_id)= hyperswitch_domain_models::payment_method_data::CardDetailsForNetworkTransactionId::get_nti_and_card_details_for_mit_flow(recurring_payment_details.clone()).get_required_value("network transaction id and card details").attach_printable("Failed to fetch network transaction id and card details for mit")?;
+ helpers::validate_card_expiry(
+ &card_details_for_network_transaction_id.card_exp_month,
+ &card_details_for_network_transaction_id.card_exp_year,
+ )?;
+
let network_transaction_id_supported_connectors = &state
.conf
.network_transaction_id_supported_connectors