From b46a921ccb05dc194253659c12991d9df7abe71e Mon Sep 17 00:00:00 2001 From: Kashif Date: Wed, 8 Jan 2025 13:19:14 +0530 Subject: [PATCH] chore(dynamic-fields): [Worldpay] update dynamic fields for payments (#7002) Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> --- .../payment_connector_required_fields.rs | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/crates/router/src/configs/defaults/payment_connector_required_fields.rs b/crates/router/src/configs/defaults/payment_connector_required_fields.rs index 9e42aec4a51d..4f6327d74b7a 100644 --- a/crates/router/src/configs/defaults/payment_connector_required_fields.rs +++ b/crates/router/src/configs/defaults/payment_connector_required_fields.rs @@ -3224,7 +3224,8 @@ impl Default for settings::RequiredFields { enums::Connector::Worldpay, RequiredFieldFinal { mandate: HashMap::new(), - non_mandate: { + non_mandate: HashMap::new(), + common: { let mut pmd_fields = HashMap::from([ ( "payment_method_data.card.card_number".to_string(), @@ -3257,7 +3258,6 @@ impl Default for settings::RequiredFields { pmd_fields.extend(get_worldpay_billing_required_fields()); pmd_fields }, - common: HashMap::new(), } ), ( @@ -6420,7 +6420,8 @@ impl Default for settings::RequiredFields { enums::Connector::Worldpay, RequiredFieldFinal { mandate: HashMap::new(), - non_mandate: { + non_mandate: HashMap::new(), + common: { let mut pmd_fields = HashMap::from([ ( "payment_method_data.card.card_number".to_string(), @@ -6453,7 +6454,6 @@ impl Default for settings::RequiredFields { pmd_fields.extend(get_worldpay_billing_required_fields()); pmd_fields }, - common: HashMap::new(), } ), ( @@ -12840,18 +12840,18 @@ impl Default for settings::RequiredFields { pub fn get_worldpay_billing_required_fields() -> HashMap { HashMap::from([ ( - "billing.address.zip".to_string(), + "billing.address.line1".to_string(), RequiredFieldInfo { - required_field: "billing.address.zip".to_string(), - display_name: "zip".to_string(), - field_type: enums::FieldType::UserAddressPincode, + required_field: "payment_method_data.billing.address.line1".to_string(), + display_name: "line1".to_string(), + field_type: enums::FieldType::UserAddressLine1, value: None, }, ), ( "billing.address.country".to_string(), RequiredFieldInfo { - required_field: "billing.address.country".to_string(), + required_field: "payment_method_data.billing.address.country".to_string(), display_name: "country".to_string(), field_type: enums::FieldType::UserAddressCountry { options: vec![ @@ -12994,5 +12994,14 @@ pub fn get_worldpay_billing_required_fields() -> HashMap