Bug:  [FEATURE] : [Multisafepay] mask pii information in connector request and response 



### Feature Description

Mask pii information passed and received in the connector request and response

### Possible Implementation

Refactor all sensitive response and request fields secret

### Have you spent some time checking if this feature request has been raised before?

- [X] I checked and didn't find a similar issue

### Have you read the Contributing Guidelines?

- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)

### Are you willing to submit a PR?

Yes, I am willing to submit a PR!
diff --git a/crates/masking/src/serde.rs b/crates/masking/src/serde.rs
index bb81717fd67..a96a87f05c8 100644
--- a/crates/masking/src/serde.rs
+++ b/crates/masking/src/serde.rs
@@ -27,6 +27,7 @@ pub trait SerializableSecret: Serialize {}
 impl SerializableSecret for Value {}
 impl SerializableSecret for u8 {}
 impl SerializableSecret for u16 {}
+impl SerializableSecret for i32 {}
 
 impl<'de, T, I> Deserialize<'de> for Secret<T, I>
 where
diff --git a/crates/router/src/connector/multisafepay/transformers.rs b/crates/router/src/connector/multisafepay/transformers.rs
index 86096ed508b..f6051ea05de 100644
--- a/crates/router/src/connector/multisafepay/transformers.rs
+++ b/crates/router/src/connector/multisafepay/transformers.rs
@@ -1,4 +1,4 @@
-use common_utils::pii::Email;
+use common_utils::pii::{Email, IpAddress};
 use masking::ExposeInterface;
 use serde::{Deserialize, Serialize};
 use url::Url;
@@ -68,7 +68,7 @@ pub enum Gateway {
 #[serde_with::skip_serializing_none]
 #[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
 pub struct Coupons {
-    pub allow: Option<Vec<String>>,
+    pub allow: Option<Vec<Secret<String>>>,
 }
 
 #[serde_with::skip_serializing_none]
@@ -126,20 +126,20 @@ pub struct Browser {
 pub struct Customer {
     pub browser: Option<Browser>,
     pub locale: Option<String>,
-    pub ip_address: Option<String>,
-    pub forward_ip: Option<String>,
-    pub first_name: Option<String>,
-    pub last_name: Option<String>,
-    pub gender: Option<String>,
-    pub birthday: Option<String>,
-    pub address1: Option<String>,
-    pub address2: Option<String>,
-    pub house_number: Option<String>,
-    pub zip_code: Option<String>,
+    pub ip_address: Option<Secret<String, IpAddress>>,
+    pub forward_ip: Option<Secret<String, IpAddress>>,
+    pub first_name: Option<Secret<String>>,
+    pub last_name: Option<Secret<String>>,
+    pub gender: Option<Secret<String>>,
+    pub birthday: Option<Secret<String>>,
+    pub address1: Option<Secret<String>>,
+    pub address2: Option<Secret<String>>,
+    pub house_number: Option<Secret<String>>,
+    pub zip_code: Option<Secret<String>>,
     pub city: Option<String>,
     pub state: Option<String>,
     pub country: Option<String>,
-    pub phone: Option<String>,
+    pub phone: Option<Secret<String>>,
     pub email: Option<Email>,
     pub user_agent: Option<String>,
     pub referrer: Option<String>,
@@ -150,7 +150,7 @@ pub struct Customer {
 pub struct CardInfo {
     pub card_number: Option<cards::CardNumber>,
     pub card_holder_name: Option<Secret<String>>,
-    pub card_expiry_date: Option<i32>,
+    pub card_expiry_date: Option<Secret<i32>>,
     pub card_cvc: Option<Secret<String>>,
     pub flexible_3d: Option<bool>,
     pub moto: Option<bool>,
@@ -159,7 +159,7 @@ pub struct CardInfo {
 
 #[derive(Clone, Debug, Eq, PartialEq, Serialize)]
 pub struct GpayInfo {
-    pub payment_token: Option<String>,
+    pub payment_token: Option<Secret<String>>,
 }
 
 #[derive(Clone, Debug, Eq, PartialEq, Serialize)]
@@ -242,7 +242,7 @@ pub struct MultisafepayPaymentsRequest {
     pub shopping_cart: Option<ShoppingCart>,
     pub items: Option<String>,
     pub recurring_model: Option<MandateType>,
-    pub recurring_id: Option<String>,
+    pub recurring_id: Option<Secret<String>>,
     pub capture: Option<String>,
     pub days_active: Option<i32>,
     pub seconds_active: Option<i32>,
@@ -423,7 +423,7 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>>
         let gateway_info = match item.router_data.request.payment_method_data {
             api::PaymentMethodData::Card(ref ccard) => Some(GatewayInfo::Card(CardInfo {
                 card_number: Some(ccard.card_number.clone()),
-                card_expiry_date: Some(
+                card_expiry_date: Some(Secret::new(
                     (format!(
                         "{}{}",
                         ccard.get_card_expiry_year_2_digit()?.expose(),
@@ -431,7 +431,7 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>>
                     ))
                     .parse::<i32>()
                     .unwrap_or_default(),
-                ),
+                )),
                 card_cvc: Some(ccard.card_cvc.clone()),
                 card_holder_name: None,
                 flexible_3d: None,
@@ -442,7 +442,9 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>>
                 api::WalletData::GooglePay(ref google_pay) => {
                     Some(GatewayInfo::Wallet(WalletInfo::GooglePay({
                         GpayInfo {
-                            payment_token: Some(google_pay.tokenization_data.token.clone()),
+                            payment_token: Some(Secret::new(
+                                google_pay.tokenization_data.token.clone(),
+                            )),
                         }
                     })))
                 }
@@ -543,7 +545,7 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>>
                 .and_then(|mandate_ids| match mandate_ids.mandate_reference_id {
                     Some(api_models::payments::MandateReferenceId::ConnectorMandateId(
                         connector_mandate_ids,
-                    )) => connector_mandate_ids.connector_mandate_id,
+                    )) => connector_mandate_ids.connector_mandate_id.map(Secret::new),
                     _ => None,
                 }),
             days_active: Some(30),
@@ -619,13 +621,13 @@ pub struct Data {
 #[derive(Default, Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
 
 pub struct MultisafepayPaymentDetails {
-    pub account_holder_name: Option<String>,
-    pub account_id: Option<String>,
-    pub card_expiry_date: Option<i32>,
+    pub account_holder_name: Option<Secret<String>>,
+    pub account_id: Option<Secret<String>>,
+    pub card_expiry_date: Option<Secret<String>>,
     pub external_transaction_id: Option<serde_json::Value>,
-    pub last4: Option<serde_json::Value>,
+    pub last4: Option<Secret<String>>,
     pub recurring_flow: Option<String>,
-    pub recurring_id: Option<String>,
+    pub recurring_id: Option<Secret<String>>,
     pub recurring_model: Option<String>,
     #[serde(rename = "type")]
     pub payment_type: Option<String>,
@@ -685,7 +687,7 @@ impl<F, T>
                             .payment_details
                             .and_then(|payment_details| payment_details.recurring_id)
                             .map(|id| types::MandateReference {
-                                connector_mandate_id: Some(id),
+                                connector_mandate_id: Some(id.expose()),
                                 payment_method_id: None,
                             }),
                         connector_metadata: None,

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

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

## Description
<!-- Describe your changes in detail -->
Mask pii information passed and received in the connector request and response for Mulisafepay.


## Test Case
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
1. Create a card payment
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key:{{api_key}}' \
--data-raw '{
  "amount": 6540,
  "currency": "USD",
  "confirm": true,
  "capture_method": "automatic",
  "capture_on": "2022-09-10T10:11:12Z",
  "customer_id": "StripeCustomer",
  "email": "abcdef123@gmail.com",
  "name": "John Doe",
  "phone": "999999999",
  "phone_country_code": "+65",
  "description": "Its my first payment request",
  "authentication_type": "no_three_ds",
  "return_url": "https://google.com",

  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "US",
      "first_name": "John",
      "last_name": "Doe"
    }
  },
  "browser_info": {
    "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
    "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
    "language": "nl-NL",
    "color_depth": 24,
    "screen_height": 723,
    "screen_width": 1536,
    "time_zone": 0,
    "java_enabled": true,
    "java_script_enabled": true,
    "ip_address": "127.0.0.1"
  },
  "shipping": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "US",
      "first_name": "John",
      "last_name": "Doe"
    }
  },
  "statement_descriptor_name": "joseph",
  "statement_descriptor_suffix": "JS",
  "metadata": {
    "udf1": "value1",
    "new_customer": "true",
    "login_date": "2019-09-10T10:11:12Z"
  },
  "payment_method": "card",
  "payment_method_data": {
    "card": {
      "card_number": "4111111111111111",
      "card_exp_month": "10",
      "card_exp_year": "25",
      "card_holder_name": "Joseph Doe",
      "card_cvc": "123"
    }
  }
}'
```
2. Check if `apple_pay_payment_token`  in the `masked_response` is masked

```
curl --location '{{base_url}}/analytics/v1/connector_event_logs?type=Payment&payment_id={{payment_id}}' \
--header 'sec-ch-ua: "Not A(Brand";v="99", "Google Chrome";v="121", "Chromium";v="121"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'authorization: Bearer JWT_token' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36' \
--header 'Content-Type: application/json' \
--header 'Referer: https://integ.hyperswitch.io/' \
--header 'api-key: {{api-key}}' \
--header 'sec-ch-ua-platform: "macOS"'
```
Response
```
request  \":\"{\\\"type\\\":\\\"direct\\\",\\\"gateway\\\":\\\"VISA\\\",\\\"order_id\\\":\\\"pay_aqRMznVMpndvmmh3IweN_1\\\",\\\"currency\\\":\\\"USD\\\",\\\"amount\\\":6540,\\\"description\\\":\\\"Its my first payment request\\\",\\\"payment_options\\\":{\\\"redirect_url\\\":\\\"http://localhost:8080/payments/pay_aqRMznVMpndvmmh3IweN/merchant_1709116328/redirect/response/multisafepay\\\",\\\"cancel_url\\\":\\\"http://localhost:8080/payments/pay_aqRMznVMpndvmmh3IweN/merchant_1709116328/redirect/response/multisafepay\\\"},\\\"customer\\\":{\\\"email\\\":\\\"*********@gmail.com\\\",\\\"reference\\\":\\\"pay_aqRMznVMpndvmmh3IweN_1\\\"},\\\"gateway_info\\\":{\\\"card_number\\\":\\\"411111**********\\\",\\\"card_holder_name\\\":null,\\\"card_expiry_date\\\":\\\"*** i32 ***\\\",\\\"card_cvc\\\":\\\"*** alloc::string::String ***\\\",\\\"flexible_3d\\\":null,\\\"moto\\\":null,\\\"term_url\\\":null},\\\"delivery\\\":{\\\"first_name\\\":\\\"*** alloc::string::String ***\\\",\\\"last_name\\\":\\\"*** alloc::string::String ***\\\",\\\"address1\\\":\\\"*** alloc::string::String ***\\\",\\\"house_number\\\":\\\"*** alloc::string::String ***\\\",\\\"zip_code\\\":\\\"*** alloc::string::String ***\\\",\\\"city\\\":\\\"San Fransico\\\",\\\"country\\\":\\\"US\\\"},\\\"days_active\\\":30,\\\"seconds_active\\\":259200}\",

"masked_response\":\"{\\\"success\\\":true,\\\"data\\\":{\\\"type\\\":null,\\\"order_id\\\":\\\"pay_aqRMznVMpndvmmh3IweN_1\\\",\\\"currency\\\":\\\"USD\\\",\\\"amount\\\":6540,\\\"description\\\":\\\"Its my first payment request\\\",\\\"capture\\\":null,\\\"payment_url\\\":\\\"https://testpay.multisafepay.com/customer-verification?sessionid=823HdSBIRUOQocDMYVsEILa3mj9hkmSKeRQ&type=3ds&md=2db93e2cd11234567890%2C0e728044058c4081898bbd2db93e2cd1&lang=en_US\\\",\\\"status\\\":\\\"initialized\\\",\\\"error_code\\\":null,\\\"error_info\\\":null,\\\"payment_details\\\":{\\\"account_holder_name\\\":null,\\\"account_id\\\":null,\\\"card_expiry_date\\\":\\\"*** alloc::string::String ***\\\",\\\"external_transaction_id\\\":null,\\\"last4\\\":\\\"*** alloc::string::String ***\\\",\\\"recurring_flow\\\":null,\\\"recurring_id\\\":null,\\\"recurring_model\\\":null,\\\"type\\\":\\\"VISA\\\"}}}\",\"error\":null,\"url\":\"https://testapi.multisafepay.com/v1/json/orders?api_key=86c095c1595b4b5cdc4462ec9b6c35ec9302a37e\",\"method\":\"POST\",\"payment_id\":\"pay_aqRMznVMpndvmmh3IweN\",\"merchant_id\":\"merchant_1709116328\",\"created_at\":1709118709865,\"request_id\":\"018def69-d6e4-7db8-b4af-f3f9b786fc84\",\"latency\":2345,\"refund_id\":null,\"dispute_id\":null,\"status_code\":200}
```


## 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
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
