Skip to content

Commit

Permalink
refactor(connector): [Mifinity] Add dynamic fields for Mifinity Wallet (
Browse files Browse the repository at this point in the history
#4943)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
  • Loading branch information
swangi-kumari and hyperswitch-bot[bot] committed Jun 11, 2024
1 parent 7b293ff commit a949676
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
6 changes: 6 additions & 0 deletions api-reference/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -9481,6 +9481,12 @@
}
}
}
},
{
"type": "string",
"enum": [
"user_date_of_birth"
]
}
],
"description": "Possible field type of required fields in payment_method_data"
Expand Down
2 changes: 2 additions & 0 deletions crates/api_models/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ pub enum FieldType {
UserBank,
Text,
DropDown { options: Vec<String> },
UserDateOfBirth,
}

impl FieldType {
Expand Down Expand Up @@ -543,6 +544,7 @@ impl PartialEq for FieldType {
options: options_other,
},
) => options_self.eq(options_other),
(Self::UserDateOfBirth, Self::UserDateOfBirth) => true,
_unused => false,
}
}
Expand Down
31 changes: 29 additions & 2 deletions crates/router/src/configs/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8087,7 +8087,35 @@ impl Default for super::settings::RequiredFields {
enums::Connector::Mifinity,
RequiredFieldFinal {
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(),
RequiredFieldInfo {
Expand Down Expand Up @@ -8193,7 +8221,6 @@ impl Default for super::settings::RequiredFields {
}
),
]),
common: HashMap::new(),
}
),
]),
Expand Down

0 comments on commit a949676

Please sign in to comment.