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(connector): [novalnet] Remove first name, last name as required fields for Applepay, Googlepay, Paypal (#7152)

Debarati Ghatakf0b443eda53b
diff --git a/crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs b/crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs
index 6d3199ecf1..c1ef6566e0 100644
--- a/crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs
@@ -86,8 +86,8 @@ pub struct NovalnetPaymentsRequestBilling {
#[derive(Default, Debug, Serialize, Clone)]
pub struct NovalnetPaymentsRequestCustomer {
- first_name: Secret<String>,
- last_name: Secret<String>,
+ first_name: Option<Secret<String>>,
+ last_name: Option<Secret<String>>,
email: Email,
mobile: Option<Secret<String>>,
billing: Option<NovalnetPaymentsRequestBilling>,
@@ -215,8 +215,8 @@ impl TryFrom<&NovalnetRouterData<&PaymentsAuthorizeRouterData>> for NovalnetPaym
};
let customer = NovalnetPaymentsRequestCustomer {
- first_name: item.router_data.get_billing_first_name()?,
- last_name: item.router_data.get_billing_last_name()?,
+ first_name: item.router_data.get_optional_billing_first_name(),
+ last_name: item.router_data.get_optional_billing_last_name(),
email: item
.router_data
.get_billing_email()
@@ -1477,8 +1477,8 @@ impl TryFrom<&SetupMandateRouterData> for NovalnetPaymentsRequest {
};
let customer = NovalnetPaymentsRequestCustomer {
- first_name: req_address.get_first_name()?.clone(),
- last_name: req_address.get_last_name()?.clone(),
+ first_name: req_address.get_optional_first_name(),
+ last_name: req_address.get_optional_last_name(),
email: item.request.get_email()?.clone(),
mobile: item.get_optional_billing_phone_number(),
billing: Some(billing),
diff --git a/crates/hyperswitch_connectors/src/utils.rs b/crates/hyperswitch_connectors/src/utils.rs
index e99777ad27..1180cb68f7 100644
--- a/crates/hyperswitch_connectors/src/utils.rs
+++ b/crates/hyperswitch_connectors/src/utils.rs
@@ -1188,6 +1188,8 @@ pub trait AddressDetailsData {
fn get_optional_city(&self) -> Option<String>;
fn get_optional_line1(&self) -> Option<Secret<String>>;
fn get_optional_line2(&self) -> Option<Secret<String>>;
+ fn get_optional_first_name(&self) -> Option<Secret<String>>;
+ fn get_optional_last_name(&self) -> Option<Secret<String>>;
}
impl AddressDetailsData for AddressDetails {
@@ -1296,6 +1298,14 @@ impl AddressDetailsData for AddressDetails {
fn get_optional_line2(&self) -> Option<Secret<String>> {
self.line2.clone()
}
+
+ fn get_optional_first_name(&self) -> Option<Secret<String>> {
+ self.first_name.clone()
+ }
+
+ fn get_optional_last_name(&self) -> Option<Secret<String>> {
+ self.last_name.clone()
+ }
}
pub trait PhoneDetailsData {
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 2ef89f440a..644c213acd 100644
--- a/crates/router/src/configs/defaults/payment_connector_required_fields.rs
+++ b/crates/router/src/configs/defaults/payment_connector_required_fields.rs
@@ -8706,24 +8706,6 @@ impl Default for settings::RequiredFields {
non_mandate: HashMap::new(),
common: HashMap::from(
[
- (
- "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,
- }
- ),
(
"billing.email".to_string(),
RequiredFieldInfo {
@@ -9032,24 +9014,6 @@ impl Default for settings::RequiredFields {
non_mandate: HashMap::new(),
common: HashMap::from(
[
- (
- "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,
- }
- ),
(
"billing.email".to_string(),
RequiredFieldInfo {
@@ -9733,24 +9697,6 @@ impl Default for settings::RequiredFields {
non_mandate: HashMap::new(),
common: HashMap::from(
[
- (
- "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,
- }
- ),
(
"billing.email".to_string(),
RequiredFieldInfo {