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

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

Swangi Kumaria949676f8b9c
diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.json
index 407fc9323d..8ff0f3eb1c 100644
--- a/api-reference/openapi_spec.json
+++ b/api-reference/openapi_spec.json
@@ -9481,6 +9481,12 @@
}
}
}
+ },
+ {
+ "type": "string",
+ "enum": [
+ "user_date_of_birth"
+ ]
}
],
"description": "Possible field type of required fields in payment_method_data"
diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs
index a10e655966..ff67df9fd7 100644
--- a/crates/api_models/src/enums.rs
+++ b/crates/api_models/src/enums.rs
@@ -459,6 +459,7 @@ pub enum FieldType {
UserBank,
Text,
DropDown { options: Vec<String> },
+ UserDateOfBirth,
}
impl FieldType {
@@ -543,6 +544,7 @@ impl PartialEq for FieldType {
options: options_other,
},
) => options_self.eq(options_other),
+ (Self::UserDateOfBirth, Self::UserDateOfBirth) => true,
_unused => false,
}
}
diff --git a/crates/router/src/configs/defaults.rs b/crates/router/src/configs/defaults.rs
index e0f735d3ac..02ba8c8bd0 100644
--- a/crates/router/src/configs/defaults.rs
+++ b/crates/router/src/configs/defaults.rs
@@ -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 {
@@ -8193,7 +8221,6 @@ impl Default for super::settings::RequiredFields {
}
),
]),
- common: HashMap::new(),
}
),
]),