mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 11:06:50 +08:00
fix(connector): [novalnet] Remove first name, last name as required fields for Applepay, Googlepay, Paypal (#7152)
This commit is contained in:
@ -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),
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user