refactor(connector): [Mifinity] Add dynamic fields for Mifinity Wallet (#4943)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Swangi Kumari
2024-06-11 20:20:31 +05:30
committed by GitHub
parent 7b293ff785
commit a949676f8b
3 changed files with 37 additions and 2 deletions

View File

@ -9481,6 +9481,12 @@
} }
} }
} }
},
{
"type": "string",
"enum": [
"user_date_of_birth"
]
} }
], ],
"description": "Possible field type of required fields in payment_method_data" "description": "Possible field type of required fields in payment_method_data"

View File

@ -459,6 +459,7 @@ pub enum FieldType {
UserBank, UserBank,
Text, Text,
DropDown { options: Vec<String> }, DropDown { options: Vec<String> },
UserDateOfBirth,
} }
impl FieldType { impl FieldType {
@ -543,6 +544,7 @@ impl PartialEq for FieldType {
options: options_other, options: options_other,
}, },
) => options_self.eq(options_other), ) => options_self.eq(options_other),
(Self::UserDateOfBirth, Self::UserDateOfBirth) => true,
_unused => false, _unused => false,
} }
} }

View File

@ -8087,7 +8087,35 @@ impl Default for super::settings::RequiredFields {
enums::Connector::Mifinity, enums::Connector::Mifinity,
RequiredFieldFinal { RequiredFieldFinal {
mandate: HashMap::new(), mandate: HashMap::new(),
non_mandate: HashMap::from([ non_mandate: HashMap::new(),
common: HashMap::from([
(
"payment_method_data.wallet.mifinity.date_of_birth".to_string(),
RequiredFieldInfo {
required_field: "payment_method_data.wallet.mifinity.date_of_birth".to_string(),
display_name: "date_of_birth".to_string(),
field_type: enums::FieldType::UserDateOfBirth,
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.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.first_name".to_string(), "billing.first_name".to_string(),
RequiredFieldInfo { RequiredFieldInfo {
@ -8193,7 +8221,6 @@ impl Default for super::settings::RequiredFields {
} }
), ),
]), ]),
common: HashMap::new(),
} }
), ),
]), ]),