Bug: [FEATURE] add requires_cvv field to customer payment method list api object



### Feature Description

We don't store the cvv in locker due to PCI compliance. Few connectors like adyen requires cvv to be collected while other connector doesn't . 

### Possible Implementation

Add new field in the customer list payment method object to include requires_cvv field which specifies whether for a given merchant, cvv is a required_field to be collected. If an entry is found in config table, then requires_cvv is set to false i.e., by default cvv is made a required_field for all merchants


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

- [X] I checked and didn't find 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/api_models/src/payment_methods.rs b/crates/api_models/src/payment_methods.rs
index 248525fcc40..f795513c6ef 100644
--- a/crates/api_models/src/payment_methods.rs
+++ b/crates/api_models/src/payment_methods.rs
@@ -577,6 +577,10 @@ pub struct CustomerPaymentMethod {
     #[cfg(feature = "payouts")]
     #[schema(value_type = Option<Bank>)]
     pub bank_transfer: Option<payouts::Bank>,
+
+    /// Whether this payment method requires CVV to be collected
+    #[schema(example = true)]
+    pub requires_cvv: bool,
 }
 #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
 pub struct PaymentMethodId {
diff --git a/crates/router/src/core/payment_methods/cards.rs b/crates/router/src/core/payment_methods/cards.rs
index 8b7db2d6c88..9dab92f67fe 100644
--- a/crates/router/src/core/payment_methods/cards.rs
+++ b/crates/router/src/core/payment_methods/cards.rs
@@ -1727,6 +1727,25 @@ pub async fn list_customer_payment_method(
     .await
     .to_not_found_response(errors::ApiErrorResponse::CustomerNotFound)?;
 
+    let is_requires_cvv = db
+        .find_config_by_key(format!("{}_requires_cvv", merchant_account.merchant_id).as_str())
+        .await;
+
+    let requires_cvv = match is_requires_cvv {
+        // If an entry is found with the config value as `false`, we set requires_cvv to false
+        Ok(value) => value.config != "false",
+        Err(err) => {
+            if err.current_context().is_db_not_found() {
+                // By default, cvv is made required field for all merchants
+                true
+            } else {
+                Err(err
+                    .change_context(errors::ApiErrorResponse::InternalServerError)
+                    .attach_printable("Failed to fetch merchant_id config for requires_cvv"))?
+            }
+        }
+    };
+
     let resp = db
         .find_payment_method_by_customer_id_merchant_id_list(
             customer_id,
@@ -1771,6 +1790,7 @@ pub async fn list_customer_payment_method(
             bank_transfer: pmd,
             #[cfg(not(feature = "payouts"))]
             bank_transfer: None,
+            requires_cvv,
         };
         customer_pms.push(pma.to_owned());
 
diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json
index 5334bf3d636..e25db0bde8b 100644
--- a/openapi/openapi_spec.json
+++ b/openapi/openapi_spec.json
@@ -4273,7 +4273,8 @@
           "customer_id",
           "payment_method",
           "recurring_enabled",
-          "installment_payment_enabled"
+          "installment_payment_enabled",
+          "requires_cvv"
         ],
         "properties": {
           "payment_token": {
@@ -4359,6 +4360,11 @@
               }
             ],
             "nullable": true
+          },
+          "requires_cvv": {
+            "type": "boolean",
+            "description": "Whether this payment method requires CVV to be collected",
+            "example": true
           }
         }
       },

## 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 -->
Added new field in the customer list payment method object to include `requires_cvv` field which specifies whether for a given merchant, cvv is a required_field to be collected. If an entry is found in config table, then requires_cvv is set to `false` i.e., by default cvv is made a required_field for all merchants 

Requires db insertion into configs table with key as `<merchant_id>_requires_cvv` and config as `false`
DB query - `insert into configs(key,config) values('<merchant_id>_requires_cvv',false);`

### Additional Changes

- [x] 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 its 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)?
-->
ListPaymentMethodForCustomer object
![image](https://github.com/juspay/hyperswitch/assets/70657455/bc5e3766-ecaf-4a21-bed2-ef52f0c5f9bd)


## 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 submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
