Bug: [REFACTOR] Multiple SDK queries fixed



Multiple SDK queries fixed:

Modified field_type text to some unique enum
Corrected multiple required fields
Voucher payments error billing.phone.number is required  fixed
Cashapp and Swish payment_experience fixed.
diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs
index 6ae46a5ede0..c2a1261508a 100644
--- a/crates/api_models/src/enums.rs
+++ b/crates/api_models/src/enums.rs
@@ -232,6 +232,7 @@ pub enum FieldType {
     UserShippingAddressPincode,
     UserShippingAddressState,
     UserShippingAddressCountry { options: Vec<String> },
+    UserSocialSecurityNumber,
     UserBlikCode,
     UserBank,
     UserBankAccountNumber,
diff --git a/crates/connector_configs/src/transformer.rs b/crates/connector_configs/src/transformer.rs
index ed3319816d5..63c7d99ee17 100644
--- a/crates/connector_configs/src/transformer.rs
+++ b/crates/connector_configs/src/transformer.rs
@@ -66,6 +66,9 @@ impl DashboardRequestPayload {
                 (_, PaymentMethodType::DirectCarrierBilling) => {
                     Some(api_models::enums::PaymentExperience::CollectOtp)
                 }
+                (_, PaymentMethodType::Cashapp) | (_, PaymentMethodType::Swish) => {
+                    Some(api_models::enums::PaymentExperience::DisplayQrCode)
+                }
                 _ => Some(api_models::enums::PaymentExperience::RedirectToUrl),
             },
         }
diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.toml
index b63c4eea2a1..6c3ba6982b3 100644
--- a/crates/connector_configs/toml/development.toml
+++ b/crates/connector_configs/toml/development.toml
@@ -189,6 +189,7 @@ merchant_secret="Source verification key"
   payment_method_type = "momo"
 [[adyen.wallet]]
   payment_method_type = "swish"
+  payment_experience = "display_qr_code"
 [[adyen.wallet]]
   payment_method_type = "touch_n_go"
 [[adyen.voucher]]
@@ -3297,6 +3298,7 @@ merchant_secret="Source verification key"
   payment_method_type = "ali_pay"
 [[stripe.wallet]]
   payment_method_type = "cashapp"
+  payment_experience = "display_qr_code"
 is_verifiable = true
 [stripe.connector_auth.HeaderKey]
 api_key="Secret Key"
diff --git a/crates/hyperswitch_domain_models/src/address.rs b/crates/hyperswitch_domain_models/src/address.rs
index c9beb359c43..f8e38ae8a35 100644
--- a/crates/hyperswitch_domain_models/src/address.rs
+++ b/crates/hyperswitch_domain_models/src/address.rs
@@ -23,10 +23,18 @@ impl Address {
                 .email
                 .clone()
                 .or(other.and_then(|other| other.email.clone())),
-            phone: self
-                .phone
-                .clone()
-                .or(other.and_then(|other| other.phone.clone())),
+            phone: {
+                self.phone
+                    .clone()
+                    .and_then(|phone_details| {
+                        if phone_details.number.is_some() {
+                            Some(phone_details)
+                        } else {
+                            None
+                        }
+                    })
+                    .or_else(|| other.and_then(|other| other.phone.clone()))
+            },
         }
     }
 }
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 3849054045c..89058884c9d 100644
--- a/crates/router/src/configs/defaults/payment_connector_required_fields.rs
+++ b/crates/router/src/configs/defaults/payment_connector_required_fields.rs
@@ -3566,9 +3566,9 @@ impl Default for settings::RequiredFields {
                                             }
                                             ),
                                             (
-                                                "payment_method_data.billing.phone.number".to_string(),
+                                                "billing.phone.number".to_string(),
                                                 RequiredFieldInfo {
-                                                    required_field: "billing.phone.number".to_string(),
+                                                    required_field: "payment_method_data.billing.phone.number".to_string(),
                                                     display_name: "phone_number".to_string(),
                                                     field_type: enums::FieldType::UserPhoneNumber,
                                                     value: None,
@@ -7072,9 +7072,9 @@ impl Default for settings::RequiredFields {
                                             }
                                             ),
                                             (
-                                                "payment_method_data.billing.phone.number".to_string(),
+                                                "billing.phone.number".to_string(),
                                                 RequiredFieldInfo {
-                                                    required_field: "billing.phone.number".to_string(),
+                                                    required_field: "payment_method_data.billing.phone.number".to_string(),
                                                     display_name: "phone_number".to_string(),
                                                     field_type: enums::FieldType::UserPhoneNumber,
                                                     value: None,
@@ -9850,9 +9850,9 @@ impl Default for settings::RequiredFields {
                                         common: HashMap::new(),
                                         non_mandate: HashMap::from([
                                             (
-                                                "payment_method_data.billing.phone.number".to_string(),
+                                                "billing.phone.number".to_string(),
                                                 RequiredFieldInfo {
-                                                    required_field: "billing.phone.number".to_string(),
+                                                    required_field: "payment_method_data.billing.phone.number".to_string(),
                                                     display_name: "phone_number".to_string(),
                                                     field_type: enums::FieldType::UserPhoneNumber,
                                                     value: None,
@@ -11195,7 +11195,7 @@ impl Default for settings::RequiredFields {
                                                     }
                                                 ),
                                                 (
-                                                    "payment_method_data.billing.phone.number".to_string(),
+                                                    "billing.phone.number".to_string(),
                                                     RequiredFieldInfo {
                                                         required_field: "payment_method_data.billing.phone.number".to_string(),
                                                         display_name: "phone_number".to_string(),
@@ -11425,9 +11425,9 @@ impl Default for settings::RequiredFields {
                                                     }
                                                 ),
                                                 (
-                                                    "payment_method_data.billing.phone.number".to_string(),
+                                                    "billing.phone.number".to_string(),
                                                     RequiredFieldInfo {
-                                                        required_field: "billing.phone.number".to_string(),
+                                                        required_field: "payment_method_data.billing.phone.number".to_string(),
                                                         display_name: "phone_number".to_string(),
                                                         field_type: enums::FieldType::UserPhoneNumber,
                                                         value: None,
@@ -11547,9 +11547,9 @@ impl Default for settings::RequiredFields {
                                                     }
                                                 ),
                                                 (
-                                                    "payment_method_data.billing.phone.number".to_string(),
+                                                    "billing.phone.number".to_string(),
                                                     RequiredFieldInfo {
-                                                        required_field: "billing.phone.number".to_string(),
+                                                        required_field: "payment_method_data.billing.phone.number".to_string(),
                                                         display_name: "phone_number".to_string(),
                                                         field_type: enums::FieldType::UserPhoneNumber,
                                                         value: None,
@@ -11675,7 +11675,7 @@ impl Default for settings::RequiredFields {
                                                 RequiredFieldInfo {
                                                     required_field: "payment_method_data.voucher.boleto.social_security_number".to_string(),
                                                     display_name: "social_security_number".to_string(),
-                                                    field_type: enums::FieldType::Text,
+                                                    field_type: enums::FieldType::UserSocialSecurityNumber,
                                                     value: None,
                                                 }
                                             ),
@@ -13299,7 +13299,7 @@ impl Default for settings::RequiredFields {
                                                     (
                                                         "payment_method_data.gift_card.number".to_string(),
                                                         RequiredFieldInfo {
-                                                            required_field: "payment_method_data.gift_card.number".to_string(),
+                                                            required_field: "payment_method_data.gift_card.givex.number".to_string(),
                                                             display_name: "gift_card_number".to_string(),
                                                             field_type: enums::FieldType::UserCardNumber,
                                                             value: None,
@@ -13308,7 +13308,7 @@ impl Default for settings::RequiredFields {
                                                     (
                                                         "payment_method_data.gift_card.cvc".to_string(),
                                                         RequiredFieldInfo {
-                                                            required_field: "payment_method_data.gift_card.cvc".to_string(),
+                                                            required_field: "payment_method_data.gift_card.givex.cvc".to_string(),
                                                             display_name: "gift_card_cvc".to_string(),
                                                             field_type: enums::FieldType::UserCardCvc,
                                                             value: None,
diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs
index d072463020a..05fd1c4d5e0 100644
--- a/crates/router/src/core/payments.rs
+++ b/crates/router/src/core/payments.rs
@@ -4557,8 +4557,10 @@ where
                 (router_data, should_continue_payment)
             }
         }
-        Some(domain::PaymentMethodData::GiftCard(_)) => {
-            if connector.connector_name == router_types::Connector::Adyen {
+        Some(domain::PaymentMethodData::GiftCard(gift_card_data)) => {
+            if connector.connector_name == router_types::Connector::Adyen
+                && matches!(gift_card_data.deref(), domain::GiftCardData::Givex(..))
+            {
                 router_data = router_data.preprocessing_steps(state, connector).await?;
 
                 let is_error_in_response = router_data.response.is_err();

## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->
Multiple SDK queries fixed:

1. Modified field_type text to some unique enum
2. Corrected multiple required fields
3. Voucher payments error billing.phone.number is required fixed
4. Cashapp and Swish payment_experience fixed.
5. Preprocessing to be done only for Givex in gift_cards


### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables

<!--
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->


## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->

## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Voucher payment
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_7u1WfwhlOfuf9PlZpwf54Ejwwi7d6cEBn51jXQiQXBzoQEY4C0CMB8ddkJ6ES0GZ' \
--data-raw '{
    "amount": 1000,
    "currency": "JPY",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 1000,
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://duck.com",
    "payment_method": "voucher",
    "payment_method_type": "seven_eleven",
	"payment_method_data": {
    	"voucher": {
        	"seven_eleven": {}
    	},
    	"billing": {
        	"address": {
            	"first_name": "joseph",
            	"last_name": "Doe"
        	},
        	"phone": {
            	"number": "9123456789",
            	"country_code": ""
        	},
        	"email": "someone@kk.com"
    	}
	}


}'
```

Response
```
{
    "payment_id": "pay_uoGRFxEqHLGs9mJHh4gs",
    "merchant_id": "merchant_1740480565",
    "status": "requires_customer_action",
    "amount": 1000,
    "net_amount": 1000,
    "shipping_cost": null,
    "amount_capturable": 1000,
    "amount_received": null,
    "connector": "adyen",
    "client_secret": "pay_uoGRFxEqHLGs9mJHh4gs_secret_iWcNQpBKiRXtrJE3Ywei",
    "created": "2025-02-25T16:02:51.611Z",
    "currency": "JPY",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": null,
        "email": null,
        "phone": null,
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "voucher",
    "payment_method_data": {
        "voucher": {
            "seven_eleven": {
                "first_name": null,
                "last_name": null,
                "email": null,
                "phone_number": null
            }
        },
        "billing": {
            "address": {
                "city": null,
                "country": null,
                "line1": null,
                "line2": null,
                "line3": null,
                "zip": null,
                "state": null,
                "first_name": "joseph",
                "last_name": "Doe"
            },
            "phone": {
                "number": "9123456789",
                "country_code": ""
            },
            "email": "someone@kk.com"
        }
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "https://duck.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_uoGRFxEqHLGs9mJHh4gs/merchant_1740480565/pay_uoGRFxEqHLGs9mJHh4gs_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "seven_eleven",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "XZ6J6GDVKX2R3M75",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "XZ6J6GDVKX2R3M75",
    "payment_link": null,
    "profile_id": "pro_XQL7oWxF1wAf4kznf1Ti",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_uzopYnVyxTBm7bzDBhJI",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-25T16:17:51.611Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-02-25T16:02:56.270Z",
    "split_payments": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null
}
```
Other refactoring is related to SDK and Dashboard WASM, so no need to test.


## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
