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
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
refactor(bank-redirect): dynamic field changes for bankredirect payment method (#4650)
Swangi Kumarida2dc10f3d72
diff --git a/crates/router/src/configs/defaults.rs b/crates/router/src/configs/defaults.rsindex 213492ac0d..1fe86a209e 100644--- a/crates/router/src/configs/defaults.rs+++ b/crates/router/src/configs/defaults.rs@@ -5672,23 +5672,32 @@ impl Default for super::settings::RequiredFields {non_mandate: HashMap::new(),common: HashMap::from([(- "payment_method_data.bank_redirect.bancontact_card.billing_details.email".to_string(),+ "billing.email".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.bancontact_card.billing_details.email".to_string(),+ required_field: "payment_method_data.billing.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(),+ "billing.address.first_name".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.bancontact_card.billing_details.billing_name".to_string(),+ required_field: "payment_method_data.billing.address.first_name".to_string(),display_name: "billing_name".to_string(),- field_type: enums::FieldType::UserBillingName,+ 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: "billing_name".to_string(),+ field_type: enums::FieldType::UserFullName,+ value: None,+ }+ ),]),}),@@ -5726,14 +5735,23 @@ impl Default for super::settings::RequiredFields {}),(- "payment_method_data.bank_redirect.bancontact_card.card_holder_name".to_string(),+ "billing.address.first_name".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.bancontact_card.card_holder_name".to_string(),+ required_field: "payment_method_data.billing.address.first_name".to_string(),display_name: "card_holder_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: "card_holder_name".to_string(),+ field_type: enums::FieldType::UserFullName,+ value: None,+ }+ ),]),})@@ -5750,9 +5768,9 @@ impl Default for super::settings::RequiredFields {mandate: HashMap::new(),non_mandate: HashMap::from([(- "payment_method_data.bank_redirect.giropay.country".to_string(),+ "billing.address.country".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.giropay.country".to_string(),+ required_field: "payment_method_data.billing.address.country".to_string(),display_name: "country".to_string(),field_type: enums::FieldType::UserCountry {options: vec![@@ -5856,9 +5874,10 @@ impl Default for super::settings::RequiredFields {RequiredFieldFinal {mandate: HashMap::new(),non_mandate: HashMap::from([- ("payment_method_data.bank_redirect.giropay.country".to_string(),+ (+ "billing.address.country".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.giropay.country".to_string(),+ required_field: "payment_method_data.billing.address.country".to_string(),display_name: "country".to_string(),field_type: enums::FieldType::UserCountry {options: vec![@@ -5869,14 +5888,23 @@ impl Default for super::settings::RequiredFields {}),(- "payment_method_data.bank_redirect.giropay.billing_details.billing_name".to_string(),- RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.giropay.billing_details.billing_name".to_string(),- display_name: "billing_name".to_string(),- field_type: enums::FieldType::UserBillingName,- value: None,- }- )+ "billing.address.first_name".to_string(),+ RequiredFieldInfo {+ required_field: "payment_method_data.billing.address.first_name".to_string(),+ display_name: "billing_name".to_string(),+ field_type: enums::FieldType::UserBillingName,+ value: None,+ }+ ),+ (+ "billing.address.last_name".to_string(),+ RequiredFieldInfo {+ required_field: "payment_method_data.billing.address.last_name".to_string(),+ display_name: "billing_name".to_string(),+ field_type: enums::FieldType::UserBillingName,+ value: None,+ }+ )]),common: HashMap::new(),}@@ -5886,14 +5914,24 @@ impl Default for super::settings::RequiredFields {RequiredFieldFinal {mandate: HashMap::new(),non_mandate: HashMap::from([- ("payment_method_data.bank_redirect.giropay.billing_details.billing_name".to_string(),- RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.giropay.billing_details.billing_name".to_string(),- display_name: "billing_name".to_string(),- field_type: enums::FieldType::UserBillingName,- value: None,- }- )+ (+ "billing.address.first_name".to_string(),+ RequiredFieldInfo {+ required_field: "payment_method_data.billing.address.first_name".to_string(),+ display_name: "billing_name".to_string(),+ field_type: enums::FieldType::UserBillingName,+ value: None,+ }+ ),+ (+ "billing.address.last_name".to_string(),+ RequiredFieldInfo {+ required_field: "payment_method_data.billing.address.last_name".to_string(),+ display_name: "billing_name".to_string(),+ field_type: enums::FieldType::UserBillingName,+ value: None,+ }+ )]),common: HashMap::new(),}@@ -5986,9 +6024,9 @@ impl Default for super::settings::RequiredFields {}),(- "payment_method_data.bank_redirect.ideal.country".to_string(),+ "billing.address.country".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.ideal.country".to_string(),+ required_field: "payment_method_data.billing.address.country".to_string(),display_name: "country".to_string(),field_type: enums::FieldType::UserCountry {options: vec![@@ -6100,9 +6138,9 @@ impl Default for super::settings::RequiredFields {mandate: HashMap::new(),non_mandate: HashMap::from([(- "payment_method_data.bank_redirect.ideal.country".to_string(),+ "billing.address.country".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.ideal.country".to_string(),+ required_field: "payment_method_data.billing.address.country".to_string(),display_name: "country".to_string(),field_type: enums::FieldType::UserCountry{options: vec![@@ -6121,19 +6159,28 @@ impl Default for super::settings::RequiredFields {RequiredFieldFinal {mandate: HashMap::new(),non_mandate: HashMap::from([- (- "payment_method_data.bank_redirect.ideal.billing_details.billing_name".to_string(),+ (+ "billing.address.first_name".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.ideal.billing_details.billing_name".to_string(),+ required_field: "payment_method_data.billing.address.first_name".to_string(),display_name: "billing_name".to_string(),- field_type: enums::FieldType::UserFullName,+ field_type: enums::FieldType::UserBillingName,value: None,}),(- "payment_method_data.bank_redirect.ideal.country".to_string(),+ "billing.address.last_name".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.ideal.country".to_string(),+ required_field: "payment_method_data.billing.address.last_name".to_string(),+ display_name: "billing_name".to_string(),+ field_type: enums::FieldType::UserBillingName,+ value: None,+ }+ ),+ (+ "billing.address.country".to_string(),+ RequiredFieldInfo {+ required_field: "payment_method_data.billing.address.country".to_string(),display_name: "country".to_string(),field_type: enums::FieldType::UserCountry{options: vec![@@ -6152,18 +6199,27 @@ impl Default for super::settings::RequiredFields {RequiredFieldFinal {mandate: HashMap::from([(- "payment_method_data.bank_redirect.ideal.billing_details.billing_name".to_string(),+ "billing.address.first_name".to_string(),+ RequiredFieldInfo {+ required_field: "payment_method_data.billing.address.first_name".to_string(),+ display_name: "billing_name".to_string(),+ field_type: enums::FieldType::UserFullName,+ value: None,+ }+ ),+ (+ "billing.address.last_name".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.ideal.billing_details.billing_name".to_string(),+ required_field: "payment_method_data.billing.address.last_name".to_string(),display_name: "billing_name".to_string(),field_type: enums::FieldType::UserFullName,value: None,}),(- "payment_method_data.bank_redirect.ideal.billing_details.email".to_string(),+ "billing.email".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.ideal.billing_details.email".to_string(),+ required_field: "payment_method_data.billing.email".to_string(),display_name: "billing_email".to_string(),field_type: enums::FieldType::UserEmailAddress,value: None,@@ -6244,9 +6300,9 @@ impl Default for super::settings::RequiredFields {RequiredFieldFinal {mandate: HashMap::new(),non_mandate: HashMap::from([- ("payment_method_data.bank_redirect.sofort.country".to_string(),- RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.sofort.country".to_string(),+ ("billing.address.country".to_string(),+ RequiredFieldInfo {+ required_field: "payment_method_data.billing.address.country".to_string(),display_name: "country".to_string(),field_type: enums::FieldType::UserCountry {options: vec![@@ -6384,9 +6440,9 @@ impl Default for super::settings::RequiredFields {RequiredFieldFinal {mandate: HashMap::new(),non_mandate: HashMap::from([- ("payment_method_data.bank_redirect.sofort.country".to_string(),+ ( "billing.address.country".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.sofort.country".to_string(),+ required_field: "payment_method_data.billing.address.country".to_string(),display_name: "country".to_string(),field_type: enums::FieldType::UserCountry {options: vec![@@ -6401,15 +6457,24 @@ impl Default for super::settings::RequiredFields {value: None,}),- (- "payment_method_data.bank_redirect.sofort.billing_details.billing_name".to_string(),- RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.sofort.billing_details.billing_name".to_string(),- display_name: "billing_name".to_string(),- field_type: enums::FieldType::UserBillingName,- value: None,- }- )+ (+ "billing.address.first_name".to_string(),+ RequiredFieldInfo {+ required_field: "payment_method_data.billing.address.first_name".to_string(),+ display_name: "billing_name".to_string(),+ field_type: enums::FieldType::UserBillingName,+ value: None,+ }+ ),+ (+ "billing.address.last_name".to_string(),+ RequiredFieldInfo {+ required_field: "payment_method_data.billing.address.last_name".to_string(),+ display_name: "billing_name".to_string(),+ field_type: enums::FieldType::UserBillingName,+ value: None,+ }+ )]),common: HashMap::new(),}@@ -6427,18 +6492,27 @@ impl Default for super::settings::RequiredFields {RequiredFieldFinal {mandate: HashMap::from([(- "payment_method_data.bank_redirect.sofort.billing_details.email".to_string(),+ "billing.email".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.sofort.billing_details.email".to_string(),+ required_field: "payment_method_data.billing.email".to_string(),display_name: "email".to_string(),field_type: enums::FieldType::UserEmailAddress,value: None,}),(- "payment_method_data.bank_redirect.sofort.billing_details.billing_name".to_string(),+ "billing.address.first_name".to_string(),+ RequiredFieldInfo {+ required_field: "payment_method_data.billing.address.first_name".to_string(),+ display_name: "billing_name".to_string(),+ field_type: enums::FieldType::UserBillingName,+ value: None,+ }+ ),+ (+ "billing.address.last_name".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.sofort.billing_details.billing_name".to_string(),+ required_field: "payment_method_data.billing.address.last_name".to_string(),display_name: "billing_name".to_string(),field_type: enums::FieldType::UserBillingName,value: None,@@ -6446,9 +6520,9 @@ impl Default for super::settings::RequiredFields {)]),non_mandate : HashMap::from([- ("payment_method_data.bank_redirect.sofort.country".to_string(),+ ("billing.address.country".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.sofort.country".to_string(),+ required_field: "payment_method_data.billing.address.country".to_string(),display_name: "country".to_string(),field_type: enums::FieldType::UserCountry {options: vec![@@ -6567,14 +6641,23 @@ impl Default for super::settings::RequiredFields {mandate: HashMap::new(),non_mandate: HashMap::from([(- "payment_method_data.bank_redirect.eps.billing_details.billing_name".to_string(),+ "billing.address.first_name".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.eps.billing_details.billing_name".to_string(),+ required_field: "payment_method_data.billing.address.first_name".to_string(),display_name: "billing_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: "billing_name".to_string(),+ field_type: enums::FieldType::UserFullName,+ value: None,+ }+ ),]),common: HashMap::new(),}@@ -6585,9 +6668,9 @@ impl Default for super::settings::RequiredFields {mandate: HashMap::new(),non_mandate: HashMap::from([(- "payment_method_data.bank_redirect.eps.country".to_string(),+ "billing.address.country".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.eps.country".to_string(),+ required_field: "payment_method_data.billing.address.country".to_string(),display_name: "bank_account_country".to_string(),field_type: enums::FieldType::UserCountry {options: vec![@@ -6637,18 +6720,27 @@ impl Default for super::settings::RequiredFields {mandate: HashMap::new(),non_mandate: HashMap::from([(- "payment_method_data.bank_redirect.eps.billing_details.billing_name".to_string(),+ "billing.address.first_name".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.eps.billing_details.billing_name".to_string(),+ required_field: "payment_method_data.billing.address.first_name".to_string(),display_name: "billing_name".to_string(),field_type: enums::FieldType::UserFullName,value: None,}),(- "payment_method_data.bank_redirect.eps.country".to_string(),+ "billing.address.last_name".to_string(),RequiredFieldInfo {- required_field: "payment_method_data.bank_redirect.eps.country".to_string(),+ required_field: "payment_method_data.billing.address.last_name".to_string(),+ display_name: "billing_name".to_string(),+ field_type: enums::FieldType::UserFullName,+ value: None,+ }+ ),+ (+ "billing.address.country".to_string(),+ RequiredFieldInfo {+ required_field: "payment_method_data.billing.address.country".to_string(),display_name: "bank_account_country".to_string(),field_type: enums::FieldType::UserCountry {options: vec![