Bug: [FEATURE] replace manual implementation using `from_str` function of strum 



### Feature Description

In the `convert_connector` function the manual implementation of converting the connector from string can be replaced using the `from_str` function provided by `strum`

### Possible Implementation

Use `from_str` function of strum

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

No, but I'm happy to collaborate on a PR with someone else
diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs
index 476d121eec5..be33941e033 100644
--- a/crates/api_models/src/enums.rs
+++ b/crates/api_models/src/enums.rs
@@ -567,7 +567,6 @@ pub enum MandateStatus {
     Clone,
     Copy,
     Debug,
-    Default,
     Eq,
     PartialEq,
     ToSchema,
@@ -584,7 +583,6 @@ pub enum Connector {
     Aci,
     Adyen,
     Airwallex,
-    Applepay,
     Authorizedotnet,
     Bitpay,
     Bluesnap,
@@ -592,8 +590,6 @@ pub enum Connector {
     Checkout,
     Coinbase,
     Cybersource,
-    #[default]
-    Dummy,
     Iatapay,
     #[cfg(feature = "dummy_connector")]
     #[serde(rename = "dummyconnector1")]
@@ -630,7 +626,6 @@ pub enum Connector {
     Worldline,
     Worldpay,
     Zen,
-    Signifyd,
 }
 
 impl Connector {
diff --git a/crates/router/src/types/api.rs b/crates/router/src/types/api.rs
index 7d80154901c..e4090ce9918 100644
--- a/crates/router/src/types/api.rs
+++ b/crates/router/src/types/api.rs
@@ -198,50 +198,94 @@ impl ConnectorData {
         _connectors: &Connectors,
         connector_name: &str,
     ) -> CustomResult<BoxedConnector, errors::ApiErrorResponse> {
-        match connector_name {
-            "aci" => Ok(Box::new(&connector::Aci)),
-            "adyen" => Ok(Box::new(&connector::Adyen)),
-            "airwallex" => Ok(Box::new(&connector::Airwallex)),
-            "authorizedotnet" => Ok(Box::new(&connector::Authorizedotnet)),
-            "bambora" => Ok(Box::new(&connector::Bambora)),
-            "bitpay" => Ok(Box::new(&connector::Bitpay)),
-            "bluesnap" => Ok(Box::new(&connector::Bluesnap)),
-            "braintree" => Ok(Box::new(&connector::Braintree)),
-            "checkout" => Ok(Box::new(&connector::Checkout)),
-            "coinbase" => Ok(Box::new(&connector::Coinbase)),
-            "cybersource" => Ok(Box::new(&connector::Cybersource)),
-            "dlocal" => Ok(Box::new(&connector::Dlocal)),
-            #[cfg(feature = "dummy_connector")]
-            "dummyconnector1" => Ok(Box::new(&connector::DummyConnector::<1>)),
-            #[cfg(feature = "dummy_connector")]
-            "dummyconnector2" => Ok(Box::new(&connector::DummyConnector::<2>)),
-            #[cfg(feature = "dummy_connector")]
-            "dummyconnector3" => Ok(Box::new(&connector::DummyConnector::<3>)),
-            "fiserv" => Ok(Box::new(&connector::Fiserv)),
-            "forte" => Ok(Box::new(&connector::Forte)),
-            "globalpay" => Ok(Box::new(&connector::Globalpay)),
-            "iatapay" => Ok(Box::new(&connector::Iatapay)),
-            "klarna" => Ok(Box::new(&connector::Klarna)),
-            "mollie" => Ok(Box::new(&connector::Mollie)),
-            "nmi" => Ok(Box::new(&connector::Nmi)),
-            // "noon" => Ok(Box::new(&connector::Noon)), added as template code for future usage
-            "nuvei" => Ok(Box::new(&connector::Nuvei)),
-            "opennode" => Ok(Box::new(&connector::Opennode)),
-            // "payeezy" => Ok(Box::new(&connector::Payeezy)), As psync and rsync are not supported by this connector, it is added as template code for future usage
-            "payu" => Ok(Box::new(&connector::Payu)),
-            "rapyd" => Ok(Box::new(&connector::Rapyd)),
-            "shift4" => Ok(Box::new(&connector::Shift4)),
-            "stripe" => Ok(Box::new(&connector::Stripe)),
-            "worldline" => Ok(Box::new(&connector::Worldline)),
-            "worldpay" => Ok(Box::new(&connector::Worldpay)),
-            "multisafepay" => Ok(Box::new(&connector::Multisafepay)),
-            "nexinets" => Ok(Box::new(&connector::Nexinets)),
-            "paypal" => Ok(Box::new(&connector::Paypal)),
-            "trustpay" => Ok(Box::new(&connector::Trustpay)),
-            "zen" => Ok(Box::new(&connector::Zen)),
-            _ => Err(report!(errors::ConnectorError::InvalidConnectorName)
+        match enums::Connector::from_str(connector_name) {
+            Ok(name) => match name {
+                enums::Connector::Aci => Ok(Box::new(&connector::Aci)),
+                enums::Connector::Adyen => Ok(Box::new(&connector::Adyen)),
+                enums::Connector::Airwallex => Ok(Box::new(&connector::Airwallex)),
+                enums::Connector::Authorizedotnet => Ok(Box::new(&connector::Authorizedotnet)),
+                enums::Connector::Bambora => Ok(Box::new(&connector::Bambora)),
+                enums::Connector::Bitpay => Ok(Box::new(&connector::Bitpay)),
+                enums::Connector::Bluesnap => Ok(Box::new(&connector::Bluesnap)),
+                enums::Connector::Braintree => Ok(Box::new(&connector::Braintree)),
+                enums::Connector::Checkout => Ok(Box::new(&connector::Checkout)),
+                enums::Connector::Coinbase => Ok(Box::new(&connector::Coinbase)),
+                enums::Connector::Cybersource => Ok(Box::new(&connector::Cybersource)),
+                enums::Connector::Dlocal => Ok(Box::new(&connector::Dlocal)),
+                #[cfg(feature = "dummy_connector")]
+                enums::Connector::DummyConnector1 => Ok(Box::new(&connector::DummyConnector::<1>)),
+                #[cfg(feature = "dummy_connector")]
+                enums::Connector::DummyConnector2 => Ok(Box::new(&connector::DummyConnector::<2>)),
+                #[cfg(feature = "dummy_connector")]
+                enums::Connector::DummyConnector3 => Ok(Box::new(&connector::DummyConnector::<3>)),
+                enums::Connector::Fiserv => Ok(Box::new(&connector::Fiserv)),
+                enums::Connector::Forte => Ok(Box::new(&connector::Forte)),
+                enums::Connector::Globalpay => Ok(Box::new(&connector::Globalpay)),
+                enums::Connector::Iatapay => Ok(Box::new(&connector::Iatapay)),
+                enums::Connector::Klarna => Ok(Box::new(&connector::Klarna)),
+                enums::Connector::Mollie => Ok(Box::new(&connector::Mollie)),
+                enums::Connector::Nmi => Ok(Box::new(&connector::Nmi)),
+                // "noon" => Ok(Box::new(&connector::Noon)), added as template code for future usage
+                enums::Connector::Nuvei => Ok(Box::new(&connector::Nuvei)),
+                enums::Connector::Opennode => Ok(Box::new(&connector::Opennode)),
+                // "payeezy" => Ok(Box::new(&connector::Payeezy)), As psync and rsync are not supported by this connector, it is added as template code for future usage
+                enums::Connector::Payu => Ok(Box::new(&connector::Payu)),
+                enums::Connector::Rapyd => Ok(Box::new(&connector::Rapyd)),
+                enums::Connector::Shift4 => Ok(Box::new(&connector::Shift4)),
+                enums::Connector::Stripe => Ok(Box::new(&connector::Stripe)),
+                enums::Connector::Worldline => Ok(Box::new(&connector::Worldline)),
+                enums::Connector::Worldpay => Ok(Box::new(&connector::Worldpay)),
+                enums::Connector::Multisafepay => Ok(Box::new(&connector::Multisafepay)),
+                enums::Connector::Nexinets => Ok(Box::new(&connector::Nexinets)),
+                enums::Connector::Paypal => Ok(Box::new(&connector::Paypal)),
+                enums::Connector::Trustpay => Ok(Box::new(&connector::Trustpay)),
+                enums::Connector::Zen => Ok(Box::new(&connector::Zen)),
+            },
+            Err(_) => Err(report!(errors::ConnectorError::InvalidConnectorName)
                 .attach_printable(format!("invalid connector name: {connector_name}")))
             .change_context(errors::ApiErrorResponse::InternalServerError),
         }
     }
 }
+
+#[cfg(test)]
+mod test {
+    #![allow(clippy::unwrap_used)]
+    use super::*;
+
+    #[test]
+    fn test_convert_connector_parsing_success() {
+        let result = enums::Connector::from_str("aci");
+        assert!(result.is_ok());
+        assert_eq!(result.unwrap(), enums::Connector::Aci);
+
+        let result = enums::Connector::from_str("shift4");
+        assert!(result.is_ok());
+        assert_eq!(result.unwrap(), enums::Connector::Shift4);
+
+        let result = enums::Connector::from_str("authorizedotnet");
+        assert!(result.is_ok());
+        assert_eq!(result.unwrap(), enums::Connector::Authorizedotnet);
+    }
+
+    #[test]
+    fn test_convert_connector_parsing_fail_for_unknown_type() {
+        let result = enums::Connector::from_str("unknowntype");
+        assert!(result.is_err());
+
+        let result = enums::Connector::from_str("randomstring");
+        assert!(result.is_err());
+    }
+
+    #[test]
+    fn test_convert_connector_parsing_fail_for_camel_case() {
+        let result = enums::Connector::from_str("Paypal");
+        assert!(result.is_err());
+
+        let result = enums::Connector::from_str("Authorizedotnet");
+        assert!(result.is_err());
+
+        let result = enums::Connector::from_str("Opennode");
+        assert!(result.is_err());
+    }
+}
diff --git a/crates/router/src/types/storage/payment_attempt.rs b/crates/router/src/types/storage/payment_attempt.rs
index bb14bbad818..c2646644273 100644
--- a/crates/router/src/types/storage/payment_attempt.rs
+++ b/crates/router/src/types/storage/payment_attempt.rs
@@ -12,6 +12,7 @@ pub struct RoutingData {
 impl crate::utils::storage_partitioning::KvStorePartition for PaymentAttempt {}
 
 #[cfg(test)]
+#[cfg(feature = "dummy_connector")]
 mod tests {
     #![allow(clippy::expect_used, clippy::unwrap_used)]
     use tokio::sync::oneshot;
@@ -34,7 +35,7 @@ mod tests {
 
         let payment_id = Uuid::new_v4().to_string();
         let current_time = common_utils::date_time::now();
-        let connector = types::Connector::Dummy.to_string();
+        let connector = types::Connector::DummyConnector1.to_string();
         let payment_attempt = PaymentAttemptNew {
             payment_id: payment_id.clone(),
             connector: Some(connector),
@@ -66,7 +67,7 @@ mod tests {
         let payment_id = Uuid::new_v4().to_string();
         let attempt_id = Uuid::new_v4().to_string();
         let merchant_id = Uuid::new_v4().to_string();
-        let connector = types::Connector::Dummy.to_string();
+        let connector = types::Connector::DummyConnector1.to_string();
 
         let payment_attempt = PaymentAttemptNew {
             payment_id: payment_id.clone(),
@@ -105,11 +106,11 @@ mod tests {
     async fn test_payment_attempt_mandate_field() {
         use crate::configs::settings::Settings;
         let conf = Settings::new().expect("invalid settings");
-        let uuid = uuid::Uuid::new_v4().to_string();
+        let uuid = Uuid::new_v4().to_string();
         let tx: oneshot::Sender<()> = oneshot::channel().0;
         let state = routes::AppState::with_storage(conf, StorageImpl::PostgresqlTest, tx).await;
         let current_time = common_utils::date_time::now();
-        let connector = types::Connector::Dummy.to_string();
+        let connector = types::Connector::DummyConnector1.to_string();
 
         let payment_attempt = PaymentAttemptNew {
             payment_id: uuid.clone(),
diff --git a/crates/router/tests/connectors/noon.rs b/crates/router/tests/connectors/noon.rs
index 6094deb8c46..7df526be2fe 100644
--- a/crates/router/tests/connectors/noon.rs
+++ b/crates/router/tests/connectors/noon.rs
@@ -16,7 +16,7 @@ impl utils::Connector for NoonTest {
         use router::connector::Noon;
         types::api::ConnectorData {
             connector: Box::new(&Noon),
-            connector_name: types::Connector::Dummy,
+            connector_name: types::Connector::DummyConnector1,
             get_token: types::api::GetToken::Connector,
         }
     }
diff --git a/crates/router/tests/connectors/payeezy.rs b/crates/router/tests/connectors/payeezy.rs
index ad7a6dad287..70745df1169 100644
--- a/crates/router/tests/connectors/payeezy.rs
+++ b/crates/router/tests/connectors/payeezy.rs
@@ -22,7 +22,7 @@ impl utils::Connector for PayeezyTest {
         use router::connector::Payeezy;
         types::api::ConnectorData {
             connector: Box::new(&Payeezy),
-            connector_name: types::Connector::Dummy,
+            connector_name: types::Connector::DummyConnector1,
             get_token: types::api::GetToken::Connector,
         }
     }

## 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 -->
- fixes #1042 
- added test cases for type conversions

### 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 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)?
-->
- added 3 unit tests supporting the change


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