From afe50d2407058b234e1e9f91f72153b880bcc8d5 Mon Sep 17 00:00:00 2001 From: swangi-kumari Date: Fri, 1 Dec 2023 19:27:10 +0530 Subject: [PATCH 1/2] feat: add required fields for bancontact_card for Mollie, Adyen and Stripe --- crates/router/src/configs/defaults.rs | 74 ++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/crates/router/src/configs/defaults.rs b/crates/router/src/configs/defaults.rs index f9bfcae1ca10..7a0583c07fcd 100644 --- a/crates/router/src/configs/defaults.rs +++ b/crates/router/src/configs/defaults.rs @@ -4125,13 +4125,85 @@ impl Default for super::settings::RequiredFields { ConnectorFields { fields: HashMap::from([ ( - enums::Connector::Stripe, + enums::Connector::Mollie, RequiredFieldFinal { mandate: HashMap::new(), non_mandate: HashMap::new(), common: HashMap::new(), } ), + ( + enums::Connector::Stripe, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from([ + ( + "payment_method_data.bank_redirect.bancontact_card.billing_details.email".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.bancontact_card.billing_details.email".to_string(), + display_name: "email".to_string(), + field_type: enums::FieldType::UserEmailAddress, + value: None, + } + ), + ( + "payment_method_data.bank_redirect.bancontact_card.billing_details.billing_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.bancontact_card.billing_details.billing_name".to_string(), + display_name: "billing_name".to_string(), + field_type: enums::FieldType::UserBillingName, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ), + ( + enums::Connector::Adyen, + RequiredFieldFinal { + mandate: HashMap::new(), + non_mandate: HashMap::from([ + ( + "payment_method_data.bank_redirect.bancontact_card.card_number".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.bancontact_card.card_number".to_string(), + display_name: "card_number".to_string(), + field_type: enums::FieldType::UserCardNumber, + value: None, + } + ), + ( + "payment_method_data.bank_redirect.bancontact_card.card_exp_month".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.bancontact_card.card_exp_month".to_string(), + display_name: "card_exp_month".to_string(), + field_type: enums::FieldType::UserCardExpiryMonth, + value: None, + } + ), + ( + "payment_method_data.bank_redirect.bancontact_card.card_exp_year".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.bancontact_card.card_exp_year".to_string(), + display_name: "card_exp_year".to_string(), + field_type: enums::FieldType::UserCardExpiryYear, + value: None, + } + ), + ( + "payment_method_data.bank_redirect.bancontact_card.card_holder_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.bank_redirect.bancontact_card.card_holder_name".to_string(), + display_name: "card_holder_name".to_string(), + field_type: enums::FieldType::UserFullName, + value: None, + } + ) + ]), + common: HashMap::new(), + } + ) ]), }, ), From 8501d6016685b38e742aa55599def011c07455b6 Mon Sep 17 00:00:00 2001 From: swangi-kumari Date: Mon, 4 Dec 2023 16:52:19 +0530 Subject: [PATCH 2/2] refactor: resolve comments --- crates/router/src/configs/defaults.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/router/src/configs/defaults.rs b/crates/router/src/configs/defaults.rs index 7a0583c07fcd..518ae0d1be56 100644 --- a/crates/router/src/configs/defaults.rs +++ b/crates/router/src/configs/defaults.rs @@ -4136,7 +4136,8 @@ impl Default for super::settings::RequiredFields { enums::Connector::Stripe, RequiredFieldFinal { mandate: HashMap::new(), - non_mandate: HashMap::from([ + non_mandate: HashMap::new(), + common: HashMap::from([ ( "payment_method_data.bank_redirect.bancontact_card.billing_details.email".to_string(), RequiredFieldInfo { @@ -4156,14 +4157,14 @@ impl Default for super::settings::RequiredFields { } ) ]), - common: HashMap::new(), } ), ( enums::Connector::Adyen, RequiredFieldFinal { mandate: HashMap::new(), - non_mandate: HashMap::from([ + non_mandate: HashMap::new(), + common:HashMap::from([ ( "payment_method_data.bank_redirect.bancontact_card.card_number".to_string(), RequiredFieldInfo { @@ -4201,7 +4202,6 @@ impl Default for super::settings::RequiredFields { } ) ]), - common: HashMap::new(), } ) ]),