From 82749d8bdcea0c4a203e8d716a2cb80f0f826028 Mon Sep 17 00:00:00 2001 From: Mrudul Vajpayee Date: Wed, 13 Nov 2024 12:57:25 +0530 Subject: [PATCH] add debit card required fields --- .../src/connectors/nexixpay.rs | 8 +- .../payment_connector_required_fields.rs | 92 +++++++++++++++++++ 2 files changed, 96 insertions(+), 4 deletions(-) diff --git a/crates/hyperswitch_connectors/src/connectors/nexixpay.rs b/crates/hyperswitch_connectors/src/connectors/nexixpay.rs index bb6b7243f086..701a0a54e4b4 100644 --- a/crates/hyperswitch_connectors/src/connectors/nexixpay.rs +++ b/crates/hyperswitch_connectors/src/connectors/nexixpay.rs @@ -48,7 +48,7 @@ use uuid::Uuid; use crate::{ constants::headers, types::ResponseRouterData, - utils::{self, PaymentMethodDataType, PaymentsAuthorizeRequestData, RefundsRequestData}, + utils::{self, PaymentMethodDataType, RefundsRequestData}, }; #[derive(Clone)] @@ -429,10 +429,10 @@ impl ConnectorIntegration CustomResult { - if req.request.connector_mandate_id().is_none() { - Ok(format!("{}/orders/3steps/init", self.base_url(connectors))) - } else { + if req.request.off_session == Some(true) { Ok(format!("{}/orders/mit", self.base_url(connectors))) + } else { + Ok(format!("{}/orders/3steps/init", self.base_url(connectors))) } } diff --git a/crates/router/src/configs/defaults/payment_connector_required_fields.rs b/crates/router/src/configs/defaults/payment_connector_required_fields.rs index c6a377294597..d746cc438336 100644 --- a/crates/router/src/configs/defaults/payment_connector_required_fields.rs +++ b/crates/router/src/configs/defaults/payment_connector_required_fields.rs @@ -1895,6 +1895,98 @@ impl Default for settings::RequiredFields { ), } ), + ( + enums::Connector::Nexixpay, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::new(), + common: HashMap::from( + [ + ( + "payment_method_data.card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "billing.address.line1".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.line1".to_string(), + display_name: "line1".to_string(), + field_type: enums::FieldType::UserAddressLine1, + value: None, + } + ), + ( + "billing.address.line2".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.line2".to_string(), + display_name: "line1".to_string(), + field_type: enums::FieldType::UserAddressLine2, + value: None, + } + ), + ( + "billing.address.city".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.city".to_string(), + display_name: "city".to_string(), + field_type: enums::FieldType::UserAddressCity, + value: None, + } + ), + ( + "billing.address.zip".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.zip".to_string(), + display_name: "zip".to_string(), + field_type: enums::FieldType::UserAddressPincode, + value: None, + } + ), + ( + "billing.address.first_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.first_name".to_string(), + display_name: "first_name".to_string(), + field_type: enums::FieldType::UserFullName, + value: None, + } + ), + ( + "billing.address.last_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.last_name".to_string(), + display_name: "last_name".to_string(), + field_type: enums::FieldType::UserFullName, + value: None, + } + ) + ] + ), + } + ), ( enums::Connector::Nmi, RequiredFieldFinal {