From b4af4c2c5d1efde6c6943780b556a077b1885dc4 Mon Sep 17 00:00:00 2001 From: chikke srujan <121822803+srujanchikke@users.noreply.github.com> Date: Mon, 3 Jun 2024 22:56:40 +0530 Subject: [PATCH 1/3] add required fields for afterpay clearpay --- .../connector_configs/toml/development.toml | 2 - crates/connector_configs/toml/sandbox.toml | 2 - crates/router/src/configs/defaults.rs | 151 ++++++++++++++++++ 3 files changed, 151 insertions(+), 4 deletions(-) diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.toml index 138fef0cdf30..0d40e81c4adb 100644 --- a/crates/connector_configs/toml/development.toml +++ b/crates/connector_configs/toml/development.toml @@ -127,8 +127,6 @@ merchant_secret="Source verification key" payment_method_type = "eps" [[adyen.bank_redirect]] payment_method_type = "blik" -[[adyen.bank_redirect]] - payment_method_type = "przelewy24" [[adyen.bank_redirect]] payment_method_type = "trustly" [[adyen.bank_redirect]] diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.toml index 7236863745da..a71933870a51 100644 --- a/crates/connector_configs/toml/sandbox.toml +++ b/crates/connector_configs/toml/sandbox.toml @@ -127,8 +127,6 @@ merchant_secret="Source verification key" payment_method_type = "eps" [[adyen.bank_redirect]] payment_method_type = "blik" -[[adyen.bank_redirect]] - payment_method_type = "przelewy24" [[adyen.bank_redirect]] payment_method_type = "trustly" [[adyen.bank_redirect]] diff --git a/crates/router/src/configs/defaults.rs b/crates/router/src/configs/defaults.rs index c989e4c04c0d..320d3d5cadfe 100644 --- a/crates/router/src/configs/defaults.rs +++ b/crates/router/src/configs/defaults.rs @@ -8110,6 +8110,157 @@ impl Default for super::settings::RequiredFields { ]), common : HashMap::new(), } + ), + ( + enums::Connector::Adyen, + RequiredFieldFinal { + mandate : HashMap::new(), + non_mandate: HashMap::from([ + ( + "billing.email".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.email".to_string(), + display_name: "email".to_string(), + field_type: enums::FieldType::UserEmailAddress, + value: None, + } + ), + ( + "billing.address.first_name".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.first_name".to_string(), + display_name: "billing_first_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_last_name".to_string(), + field_type: enums::FieldType::UserBillingName, + 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.line2".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.line2".to_string(), + display_name: "line2".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.address.zip".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.zip".to_string(), + display_name: "zip".to_string(), + field_type: enums::FieldType::UserAddressPincode, + 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::UserAddressCountry{ + options: vec![ + "GB".to_string(), + ] + }, + value: None, + } + ), + ( + "billing.address.state".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.billing.address.state".to_string(), + display_name: "state".to_string(), + field_type: enums::FieldType::UserAddressState, + value: None, + } + ), + ( + "shipping.address.city".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.shipping.address.city".to_string(), + display_name: "city".to_string(), + field_type: enums::FieldType::UserShippingAddressCity, + value: None, + } + ), + ( + "shipping.address.state".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.shipping.address.state".to_string(), + display_name: "state".to_string(), + field_type: enums::FieldType::UserShippingAddressState, + value: None, + } + ), + ( + "shipping.address.zip".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.shipping.address.zip".to_string(), + display_name: "zip".to_string(), + field_type: enums::FieldType::UserShippingAddressPincode, + value: None, + } + ), + ( + "shipping.address.country".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.shipping.address.country".to_string(), + display_name: "country".to_string(), field_type: enums::FieldType::UserShippingAddressCountry{ + options: vec![ + "GB".to_string(), + ] + }, + value: None, + } + ), + ( + "shipping.address.line1".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.shipping.address.line1".to_string(), + display_name: "line1".to_string(), + field_type: enums::FieldType::UserShippingAddressLine1, + value: None, + } + ), + ( + "shipping.address.line2".to_string(), + RequiredFieldInfo { + required_field: "payment_method_data.shipping.address.line2".to_string(), + display_name: "street".to_string(), + field_type: enums::FieldType::UserShippingAddressLine1, + value: None, + } + ), + ]), + common : HashMap::new(), + } ) ]), }, From 4baed35dc9aab301e88afd27077f0439e208df1a Mon Sep 17 00:00:00 2001 From: chikke srujan <121822803+srujanchikke@users.noreply.github.com> Date: Tue, 4 Jun 2024 11:02:44 +0530 Subject: [PATCH 2/3] remove shipping address from default.rs --- crates/router/src/configs/defaults.rs | 57 --------------------------- 1 file changed, 57 deletions(-) diff --git a/crates/router/src/configs/defaults.rs b/crates/router/src/configs/defaults.rs index 320d3d5cadfe..c7a5aad8caf4 100644 --- a/crates/router/src/configs/defaults.rs +++ b/crates/router/src/configs/defaults.rs @@ -8201,63 +8201,6 @@ impl Default for super::settings::RequiredFields { value: None, } ), - ( - "shipping.address.city".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.shipping.address.city".to_string(), - display_name: "city".to_string(), - field_type: enums::FieldType::UserShippingAddressCity, - value: None, - } - ), - ( - "shipping.address.state".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.shipping.address.state".to_string(), - display_name: "state".to_string(), - field_type: enums::FieldType::UserShippingAddressState, - value: None, - } - ), - ( - "shipping.address.zip".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.shipping.address.zip".to_string(), - display_name: "zip".to_string(), - field_type: enums::FieldType::UserShippingAddressPincode, - value: None, - } - ), - ( - "shipping.address.country".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.shipping.address.country".to_string(), - display_name: "country".to_string(), field_type: enums::FieldType::UserShippingAddressCountry{ - options: vec![ - "GB".to_string(), - ] - }, - value: None, - } - ), - ( - "shipping.address.line1".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.shipping.address.line1".to_string(), - display_name: "line1".to_string(), - field_type: enums::FieldType::UserShippingAddressLine1, - value: None, - } - ), - ( - "shipping.address.line2".to_string(), - RequiredFieldInfo { - required_field: "payment_method_data.shipping.address.line2".to_string(), - display_name: "street".to_string(), - field_type: enums::FieldType::UserShippingAddressLine1, - value: None, - } - ), ]), common : HashMap::new(), } From c4ac850dc11aac0ce73f1066c8666d20a0c6fdaf Mon Sep 17 00:00:00 2001 From: chikke srujan <121822803+srujanchikke@users.noreply.github.com> Date: Tue, 4 Jun 2024 11:52:02 +0530 Subject: [PATCH 3/3] minor refactor --- crates/router/src/configs/defaults.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/router/src/configs/defaults.rs b/crates/router/src/configs/defaults.rs index c7a5aad8caf4..7177488cb3cc 100644 --- a/crates/router/src/configs/defaults.rs +++ b/crates/router/src/configs/defaults.rs @@ -8157,7 +8157,7 @@ impl Default for super::settings::RequiredFields { RequiredFieldInfo { required_field: "payment_method_data.billing.address.line2".to_string(), display_name: "line2".to_string(), - field_type: enums::FieldType::UserAddressLine1, + field_type: enums::FieldType::UserAddressLine2, value: None, } ),