Bug: add `email` in `billing` and `shipping` address of merchant payment method list



This is to extend the feature of [collect address details](https://github.com/juspay/hyperswitch/pull/5418) to collect `billing.email` and `shipping.email`.

As per this when `"always_collect_shipping_details_from_wallet_connector": true` and `"always_collect_billing_details_from_wallet_connector": true`, if payment method is wallet or paylater, and if payment experience is `"payment_experience_type": "invoke_sdk_client"` then merchant pml will contain `billing.email` and `shipping.email` in addition to existing fields.
diff --git a/crates/router/src/configs/defaults.rs b/crates/router/src/configs/defaults.rs
index 41efc6e4c38..5719e111759 100644
--- a/crates/router/src/configs/defaults.rs
+++ b/crates/router/src/configs/defaults.rs
@@ -12353,6 +12353,15 @@ pub fn get_billing_required_fields() -> HashMap<String, RequiredFieldInfo> {
                 value: None,
             },
         ),
+        (
+            "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,
+            },
+        ),
     ])
 }
 
@@ -12441,6 +12450,15 @@ pub fn get_shipping_required_fields() -> HashMap<String, RequiredFieldInfo> {
                 value: None,
             },
         ),
+        (
+            "shipping.email".to_string(),
+            RequiredFieldInfo {
+                required_field: "shipping.email".to_string(),
+                display_name: "email".to_string(),
+                field_type: enums::FieldType::UserEmailAddress,
+                value: None,
+            },
+        ),
     ])
 }
 

## 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 -->
This is to extend the feature of [collect address details](https://github.com/juspay/hyperswitch/pull/5418) to collect `billing.email` and `shipping.email`.

### 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)?
-->
-> Create a merchant account
-> Set the below config in the business profile
```
curl --location 'http://localhost:8080/account/merchant_1726839405/business_profile/pro_TwNiv0vtGBct5t1SLyhm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: *' \
--data '{
    "collect_billing_details_from_wallet_connector": false,
    "collect_shipping_details_from_wallet_connector": false,
    "always_collect_shipping_details_from_wallet_connector": true,
    "always_collect_billing_details_from_wallet_connector": true
}'
```
```
{
    "merchant_id": "merchant_1726839405",
    "profile_id": "pro_TwNiv0vtGBct5t1SLyhm",
    "profile_name": "US_default",
    "return_url": "https://google.com/success",
    "enable_payment_response_hash": true,
    "payment_response_hash_key": "ODPObMKINwvWuUGwHgikqYs7XC3jpRpnPpicIK4IFP3flJ3ZeEREOzagzyEHOGTz",
    "redirect_to_merchant_with_http_post": false,
    "webhook_details": {
        "webhook_version": "1.0.1",
        "webhook_username": "ekart_retail",
        "webhook_password": "password_ekart@123",
        "webhook_url": null,
        "payment_created_enabled": true,
        "payment_succeeded_enabled": true,
        "payment_failed_enabled": true
    },
    "metadata": null,
    "routing_algorithm": null,
    "intent_fulfillment_time": 900,
    "frm_routing_algorithm": null,
    "payout_routing_algorithm": null,
    "applepay_verified_domains": null,
    "session_expiry": 900,
    "payment_link_config": null,
    "authentication_connector_details": null,
    "use_billing_as_payment_method_billing": true,
    "extended_card_info_config": null,
    "collect_shipping_details_from_wallet_connector": false,
    "collect_billing_details_from_wallet_connector": false,
    "always_collect_shipping_details_from_wallet_connector": true,
    "always_collect_billing_details_from_wallet_connector": true,
    "is_connector_agnostic_mit_enabled": false,
    "payout_link_config": null,
    "outgoing_webhook_custom_http_headers": null,
    "tax_connector_id": null,
    "is_tax_connector_enabled": false,
    "is_network_tokenization_enabled": false
}
```
-> Create a connector with wallet or paylater payment method enabled
-> Create a payment with confirm false
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: ' \
--data '{
  "amount": 100000,
  "currency": "USD",
  "capture_method": "automatic",
  "authentication_type": "no_three_ds",
  "confirm": false,
  "customer_id": "cu_1726839665"
}'
```
```
{
    "payment_id": "pay_mtBJnDsvfQoVztmE4Zl1",
    "merchant_id": "merchant_1726839405",
    "status": "requires_payment_method",
    "amount": 100000,
    "net_amount": 100000,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": null,
    "client_secret": "pay_mtBJnDsvfQoVztmE4Zl1_secret_LInppcvLGbtw5KB8YWWj",
    "created": "2024-09-20T13:37:30.990Z",
    "currency": "USD",
    "customer_id": "cu_1726839451",
    "customer": {
        "id": "cu_1726839451",
        "name": null,
        "email": null,
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "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": null,
    "payment_method_data": null,
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": null,
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "cu_1726839451",
        "created_at": 1726839450,
        "expires": 1726843050,
        "secret": "epk_8f8412ffd628422c8c108e8c75cef572"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_TwNiv0vtGBct5t1SLyhm",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": null,
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-09-20T13:52:30.990Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-09-20T13:37:31.050Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null
}
```
-> Merchant payment method list
```
curl --location 'http://localhost:8080/account/payment_methods?client_secret=pay_mtBJnDsvfQoVztmE4Zl1_secret_LInppcvLGbtw5KB8YWWj' \
--header 'Accept: application/json' \
--header 'api-key: '
```
```
{
    "redirect_url": "https://google.com/success",
    "currency": "USD",
    "payment_methods": [
        {
            "payment_method": "pay_later",
            "payment_method_types": [
                {
                    "payment_method_type": "klarna",
                    "payment_experience": [
                        {
                            "payment_experience_type": "invoke_sdk_client",
                            "eligible_connectors": [
                                "klarna"
                            ]
                        }
                    ],
                    "card_networks": null,
                    "bank_names": null,
                    "bank_debits": null,
                    "bank_transfers": null,
                    "required_fields": {
                        "billing.address.line1": {
                            "required_field": "payment_method_data.billing.address.line1",
                            "display_name": "line1",
                            "field_type": "user_address_line1",
                            "value": null
                        },
                        "shipping.address.country": {
                            "required_field": "shipping.address.country",
                            "display_name": "country",
                            "field_type": {
                                "user_shipping_address_country": {
                                    "options": [
                                        "ALL"
                                    ]
                                }
                            },
                            "value": null
                        },
                        "shipping.address.zip": {
                            "required_field": "shipping.address.zip",
                            "display_name": "zip",
                            "field_type": "user_shipping_address_pincode",
                            "value": null
                        },
                        "shipping.phone.number": {
                            "required_field": "shipping.phone.number",
                            "display_name": "phone_number",
                            "field_type": "user_phone_number",
                            "value": null
                        },
                        "shipping.address.line1": {
                            "required_field": "shipping.address.line1",
                            "display_name": "line1",
                            "field_type": "user_shipping_address_line1",
                            "value": null
                        },
                        "shipping.phone.country_code": {
                            "required_field": "shipping.phone.country_code",
                            "display_name": "dialing_code",
                            "field_type": "user_phone_number_country_code",
                            "value": null
                        },
                        "shipping.address.city": {
                            "required_field": "shipping.address.city",
                            "display_name": "city",
                            "field_type": "user_shipping_address_city",
                            "value": null
                        },
                        "billing.address.line2": {
                            "required_field": "payment_method_data.billing.address.line2",
                            "display_name": "line2",
                            "field_type": "user_address_line2",
                            "value": null
                        },
                        "shipping.email": {
                            "required_field": "shipping.email",
                            "display_name": "email",
                            "field_type": "user_email_address",
                            "value": null
                        },
                        "billing.address.city": {
                            "required_field": "payment_method_data.billing.address.city",
                            "display_name": "city",
                            "field_type": "user_address_city",
                            "value": null
                        },
                        "billing.address.first_name": {
                            "required_field": "payment_method_data.billing.address.first_name",
                            "display_name": "billing_first_name",
                            "field_type": "user_billing_name",
                            "value": null
                        },
                        "shipping.address.state": {
                            "required_field": "shipping.address.state",
                            "display_name": "state",
                            "field_type": "user_shipping_address_state",
                            "value": null
                        },
                        "billing.phone.country_code": {
                            "required_field": "payment_method_data.billing.phone.country_code",
                            "display_name": "dialing_code",
                            "field_type": "user_phone_number_country_code",
                            "value": null
                        },
                        "billing.address.last_name": {
                            "required_field": "payment_method_data.billing.address.last_name",
                            "display_name": "billing_last_name",
                            "field_type": "user_billing_name",
                            "value": null
                        },
                        "billing.address.country": {
                            "required_field": "payment_method_data.billing.address.country",
                            "display_name": "country",
                            "field_type": {
                                "user_address_country": {
                                    "options": [
                                        "ALL"
                                    ]
                                }
                            },
                            "value": null
                        },
                        "billing.address.state": {
                            "required_field": "payment_method_data.billing.address.state",
                            "display_name": "state",
                            "field_type": "user_address_state",
                            "value": null
                        },
                        "billing.address.zip": {
                            "required_field": "payment_method_data.billing.address.zip",
                            "display_name": "zip",
                            "field_type": "user_address_pincode",
                            "value": null
                        },
                        "billing.phone.number": {
                            "required_field": "payment_method_data.billing.phone.number",
                            "display_name": "phone_number",
                            "field_type": "user_phone_number",
                            "value": null
                        },
                        "shipping.address.last_name": {
                            "required_field": "shipping.address.last_name",
                            "display_name": "shipping_last_name",
                            "field_type": "user_shipping_name",
                            "value": null
                        },
                        "shipping.address.first_name": {
                            "required_field": "shipping.address.first_name",
                            "display_name": "shipping_first_name",
                            "field_type": "user_shipping_name",
                            "value": null
                        },
                        "billing.email": {
                            "required_field": "payment_method_data.billing.email",
                            "display_name": "email",
                            "field_type": "user_email_address",
                            "value": null
                        }
                    },
                    "surcharge_details": null,
                    "pm_auth_connector": null
                }
            ]
        }
    ],
    "mandate_payment": null,
    "merchant_name": "NewAge Retailer",
    "show_surcharge_breakup_screen": false,
    "payment_type": "normal",
    "request_external_three_ds_authentication": false,
    "collect_shipping_details_from_wallets": true,
    "collect_billing_details_from_wallets": true,
    "is_tax_calculation_enabled": false
}
```




## 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
